<input name=”demo” type=”text” id=”demo” onkeypress=”var unicode=event.keyCode? event.keyCode : event.charCode;if ((unicode < 32 || unicode > 33)&&(unicode < 45 || unicode > 57)) return false; return true;”>
This code compatible to all browsers !
<input name=”demo” type=”text” id=”demo” onkeypress=”var unicode=event.keyCode? event.keyCode : event.charCode;if ((unicode < 32 || unicode > 33)&&(unicode < 45 || unicode > 57)) return false; return true;”>
This code compatible to all browsers !
But this code is not working in FF
Sorry!!! its working now
the problem was in my side
Sorry Once again
Hi Arun,
In your code doesnot allows the back space key.So i rewrite the code as follows
function IsNumeric(event)
{
var unicode=event.keyCode? event.keyCode: event.charCode;
if ((unicode 33)&&(unicode 57) )
{
if(unicode==8)
{
return true;
}
return false;
}
return true;
}
Thanks
Thanks Kushal ..
Good job ..
-Arun