The following example shows how to validate an entered email address.An email address must contain at least a ‘@’ sign and a dot (.).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.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.The user should select an option other than this ‘Select One’ item.Form validation normally used to occur at the server, after the client had entered all the necessary data and then pressed the Submit button.The idea is to create a set of “validation descriptors” associated with each element in a form.
When there are many fields in the form, the Java Script validation becomes too complex.
The Java Script class presented here makes the form validations many times easier.
The script has a catalog of almost all the common validation types built-in.
This validation descriptor is valid only for drop down lists.
The drop down select list boxes usually will have one item saying ‘Select One’ (and that item will be selected by default).
It's also very precise, as you can point out the exact field where there's a problem.