function ValidationCheckforNumeric(txtVal)
{
var len = txtVal.value.length;
var charVal = 0;
for (var i=0;i {
charVal = txtVal.value.charCodeAt(i);
if (!((charVal >= 48 && charVal <= 57)))
{
alert("Only Numeric Values are Allowed");
txtVal.value = '';
txtVal.focus();
return false;
}
}
return true;
}
input type="text" id="txtNumber" onchange='ValidationCheckforNumeric(this)'
No comments:
Post a Comment