Added numeric keypad and allow for decimal/thousand separator. Lot of comments that this won't solve all numeric entry problems and that's very true - it's not meant to. You will still need to validate the final input for proper formatting etc. Nice piece of work - as you say, it's not a validator, but an entry [email protected] - sometimes, when users & the readers of form entries aren't computer literate, we do need to restrict what people can type, to limit [email protected] - I recommend you check out my key code checker which makes it easy to find the key codes to block or perform special actions for.
So your plugin actually allows French users to type things like &é"' but they cannot type any digits at all.
The example page is at Yes this doesn't work for *validating* numeric input, so if you paste this doesn't do the trick.
But that's not the focus of this little plug-in - that's validation plug-ins are for.
(using IE 7.0.6) I just put above advice into the code.
As far as i know IE does not have any problems with regular expressions at all. @mathewgk80 For allowing only numeric values to be placed inside a text box using Java Script, we need to capture the “on Key Down” event for the keyboard.
This is very helpful when testing for Username, password, dollar amounts, etc.