JavaScript to limit form field input text to specific characters
The first field will only accept characters I have identified as appropriate for a person's name (alphabetical, space, hyphen, apostrophe, and period).
The second field will only accept letters.
The third field will only accept numbers.
The fourth field will only accept "name characters" and "numbers".
As you press down on each key on your keyboard, the keystroke is intercepted and only allows the value to be "accepted" if it matches the required criteria.
Here is what the form looks like - I use the "onkeypress" event to call "inputLimiter" with the name of the type of text I want to limit it to:
Here is the function. Notice that the names of the text-types are very easy to configure - just add a new allow == 'Letters' then type out each fo the characters you want to allow in the AllowableCharacters= section.