-------------------------------------------------------
<input type="text" onkeypress="return isNumberKey(event);">
<script>
function isNumberKey(my_event)
{
var charCode = (my_event.which) ? my_event.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
{
alert("Only Numbers");
return false;
}
return true;
}
</script>
-------------------------------------------------------
<input type="text" onkeypress="return isNumberKey(event);">
<script>
function isNumberKey(my_event)
{
var charCode = (my_event.which) ? my_event.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
{
alert("Only Numbers");
return false;
}
return true;
}
</script>
-------------------------------------------------------
No comments:
Post a Comment