To take things a step further you can even explore Ajax Form Validation which lets you supply real-time feedback using server-side scripts triggered by Java Script events.
The team at have made a video based on this article as a part of their Java Script training lessons which you can view below. Would be great if you could post full examples of code including form and not just pieces that fit into the greater framework of code.
From numbers we’ll move to alphabets first an example for validation lowercase alphabets and then to validate both uppercase and lowercase.
Here we create a Reg Exp pattern and use the match to validate it.
The value of a text input box (or a textarea or password input) is available using the syntax that tells you which option has been selected.The illustration below shows this relationship: Note that the 'I' in selected Index needs to be capitalised - Java Script functions and variables are always case-sensitive. Read more about the humble checkbox in our HTML5 Checkbox Validation article.Radio buttons are implemented as if they were an array of checkboxes.All you need to do is extend the command, in which case the form will be submitted.You'll see that the all validation scripts presented on this and subsequent pages adhere to the same basic format.