Sample Source Code:
<html>
<head>
<script language=Javascript>
function getInput(evt) {
var ascII = (evt.which) ? evt.which : event.keyCode;
if (ascII < 48 || ascII > 57)
return false;
return true;
}
</script>
</head>
<body>
You can input numeric values only: <br>
<input type="text" onkeypress="return getInput(event)" />
</body>
</html>
No comments:
Post a Comment