Last active
December 20, 2015 23:48
-
-
Save renie/6214708 to your computer and use it in GitHub Desktop.
Just numbers on html input
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
onkeyup="this.value = isNaN(this.value.substr(this.value.length-1>0?this.value.length-1:0, this.value.length-1>1?this.value.length-1:1))?(this.value.length<2?"":this.value.substr(0,this.value.length-1)).replace(/\s+/g,""):this.value.replace(/\s+/g,"")" | |
onkeypress="this.value = isNaN(this.value.substr(this.value.length-1>0?this.value.length-1:0, this.value.length-1>1?this.value.length-1:1))?(this.value.length<2?"":this.value.substr(0,this.value.length-1)).replace(/\s+/g,""):this.value.replace(/\s+/g,"")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment