The drop down select list boxes usually will have one item saying ‘Select One’ (and that item will be selected by default).
The user should select an option other than this ‘Select One’ item.
For example, you can have an input field that should not be empty, should be less than 25 chars and should be alpha-numeric. In some dynamically programmed pages, it may be required to change the validations in the form at run time.
In other words, in order to validate a field, you just associate a set of validation descriptors for each input field in the form. For such cases, a function is included which clears all validations in the validator object. Note that this validation if for fields like Textbox and multi-line text box.
Each field in the form can have zero one or more validations. More info & downloads where Do My Validation One() and Do My Validation Two() are custom functions for validation.
So, most of the web developers prefer Java Script form validation.
There are many more rules but let's leave it at these basic rules.
In this tutorial you will see how to use regular expressions to validate.
Through a list of examples , we will build a script to validate phone numbers , UK postal codes, along with more examples.