function CHKNUM(e,idtxt)
{
var txt = document.getElementById(idtxt);
if(e.keyCode < 48 || e.keyCode > 57)// && ( keyCode != 8 || e.keyCode != 13))
{
if(e.keyCode != 13 && e.keyCode != 8)
{
alert("keyCode for the key pressed: " + e.keyCode + "\n");
alert("Please enter Numbers Only.");
txt.value="";
txt.focus();
return false;
}
}
else
{
return true;
}
}
No comments:
Post a Comment