How do I make it so the input field only displays only numbers and not some other character? Like when someone types in a letter nothing comes out in the field but when it's a number it immediately gets displayed.
<input type="text" onkeyup="this.value = this.value.replace(/[^\d]/, '');" /> HTML: Untested but should work.