Created
April 29, 2016 21:10
-
-
Save channingwalton/3f5390e4e42854036f457745d7214704 to your computer and use it in GitHub Desktop.
positive numbers only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SCRIPT language=Javascript> | |
<!-- | |
function isNumberKey(evt) | |
{ | |
var charCode = (evt.which) ? evt.which : event.keyCode | |
return charCode > 47 && charCode < 58; | |
} | |
//--> | |
</SCRIPT> | |
</HEAD> | |
<BODY> | |
<INPUT id="txtChar" onkeypress="return isNumberKey(event)" type="text" name="txtChar" maxLength="3"> | |
</BODY> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment