//Js Code
function numberValidation(txtbx,event)
{
var txtbx1=document.getElementById(txtbx);
if((event.keyCode >= 48 && event.keyCode <= 57)||(event.keyCode >= 96 && event.keyCode <= 105)||(event.keyCode == 8 ) ||(event.keyCode == 9) || (event.keyCode == 12) || (event.keyCode == 27) || (event.keyCode == 37) || (event.keyCode == 39) || (event.keyCode == 46) )
{
return true;
}
else
{
alert("Only Numeric Value");
txtbx1.value="";
return false;
}
}
//.cs file (PageLoad)
textbox1.Attributes.Add("onKeyDown", "return numberValidation('" + textbox1.ClientID + "',event);");
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment