Write this in the Head Part of the HTML Side
<script language="Javascript">
function fnAllowAlphaNumericSpace()
{
if ((event.keyCode < 48 || event.keyCode > 57 ) && (event.keyCode != 46 && event.keyCode != 32) && (event.keyCode < 65 || event.keyCode > 90) && (event.keyCode < 97 || event.keyCode > 122)) event.returnValue = false;
}
</script>
Write this in the Page_Load of the WebForm thats the CodeBehind Side.
this.txtFirstName.Attributes["OnKeyPress"] = "Javascript:return fnAllowAlphaNumericSpace()";
Saturday, August 18, 2007
JavaScripts to Allow Alfabets+Numeric+Space for a TextBox
Posted by
Rutts
at
1:37 PM
Labels: Java Scripts
Subscribe to:
Post Comments (Atom)


1 comments:
Keep up the good work.
Post a Comment