Is there a quick way to set an HTML text input () to only allow numeric keystrokes (plus \'.\')?
I've searched long and hard for a good answer to this, and we desperately need , but short of that, these 2 are the most concise ways I could come up with:
If you dislike the non-accepted character showing for a split-second before being erased, the method below is my solution. Note the numerous additional conditions, this is to avoid disabling all sorts of navigation and hotkeys. If anyone knows how to compactify this, let us know!