pr.nimbalkar Posted December 14, 2006 Share Posted December 14, 2006 Hi friends, function changeVal(obj,val){ var i = val.indexOf("."); var l = val.substring(i,val.length); if(l.length > 2) { alert("There should be only one numeric value after the decimal point"); setTimeout('obj.focus();',1); return false; } }This script gives an error 'obj' not defined.How to fix this bug? Link to comment Share on other sites More sharing options...
aspnetguy Posted December 14, 2006 Share Posted December 14, 2006 I have a hard time getting setTimeout to work sometimes too. Try this. function changeVal(obj,val){ var i = val.indexOf("."); var l = val.substring(i,val.length); if(l.length > 2) { alert("There should be only one numeric value after the decimal point"); setTimeout(setFocus,1); return false; } function setFocus() { obj.focus(); }} try that Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now