Number restriction in textbox using javascript  

Posted by Kishore in

I have a developed this simple javascript to allow user to key in only numerics and dot(for decimals).

function verify(e)
{
var zero=48;
var nine=57;
var dot=46;
if((e.keyCode==dot)||(e.keyCode>=zero && e.keyCode<=nine)){
return true;
}
return false;
}

This entry was posted on Nov 4, 2008 at Tuesday, November 04, 2008 and is filed under . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment