<script type="text/javascript">
function Validation(){
var a=document.getElementById('MyTextBox').value;
var regex1=/^[0-9]*$/;
if(regex1.test(a)== false){
alert('Please enter only Numeric value ');
MyTextBox.focus();
return false;
}
else {
alert('Accepted ');
}
}
</script>
****************************
<html>
<body>
<INPUT name="MyTextBox" type="text" id="MyTextBox">
<INPUT onClick="Validation();" id=Button1 type=button value="Test
Number!" name=btnTest>
</body>
</html>
[ add comment ] | permalink |




( 3 / 15 )
Calendar



