ASP.NET with C# and SQL SERVER , some vb.net . asp.net examples, asp.net codes, asp.net programs, c# code, sql server queries, important codes.
Saturday, 20 October 2012
alpha Numeric validation in javascript
// check the user id
function IsalphaNumericValidate(e)
{
var key;
if (e.keyCode)
key = e.keyCode;
else if (e.which)
key = e.which;
if (/[^A-Za-z0-9.]/.test(String.fromCharCode(key)))
{ //fails test
alert("invalid");
document.getElementById("<%=txtUserName.ClientID %>").focus();
return false;
}
return true;
}
================================
onkeypress="Javascript:return IsalphaNumericValidate(event)"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment