<script type="text/javascript">
function ValidateInput(evt)
{
var valRegExp = new RegExp("^[a-zA-Z0-9]");
if (valRegExp.test(String.fromCharCode(evt.which)))
{
return true;
}
else
{
return false;
}
}
</script>
</head>
<body>
<label for="txtUsername">Username</lable>
<input type="text" id="txtUsername" placeholder="Enter Username" onkeypress="return ValidateInput(event)"/>
</body>
function ValidateInput(evt)
{
var valRegExp = new RegExp("^[a-zA-Z0-9]");
if (valRegExp.test(String.fromCharCode(evt.which)))
{
return true;
}
else
{
return false;
}
}
</script>
</head>
<body>
<label for="txtUsername">Username</lable>
<input type="text" id="txtUsername" placeholder="Enter Username" onkeypress="return ValidateInput(event)"/>
</body>
No comments:
Post a Comment