Created
February 22, 2013 22:14
-
-
Save enlacee/5016968 to your computer and use it in GitHub Desktop.
Solo numeros en Firefox and IExplorer
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
<html> | |
<script type="text/javascript"> | |
var nav4 = window.Event ? true : false; | |
function IsNumber(event){ | |
// Backspace = 8, Enter = 13, ’0′ = 48, ’9′ = 57, ‘.’ = 46 | |
var key = nav4 ? event.which : event.keyCode; | |
return (key <= 13 || (key >= 48 && key <= 57) || key == 46); | |
} | |
</script> | |
<body> | |
<input type="text" name ="name" value="aa" onkeypress="return IsNumber(event)"> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
buena