Javascript Limit Input

Often we need to prevent a user from using certain characters in inputs. Here is a brief snippet that seems to work pretty well for restricting a user’s input to 0-9 a-zA-Z. Also allows, returns, backspace and shift.

Also ended up making one for numbers / currency.


Zip Input