The following code shows the implementation of this validate() function.
Now we will see how we can validate our entered form data before submitting it to the web server.
Using client side Java Script is an efficient way to validate the user input in web forms.
When there are many fields in the form, the Java Script validation becomes too complex.
Server side validation is performed by a web server, after input has been sent to the server.
The name can’t be empty and password can’t be less than 6 characters long. The user will not be forwarded to the next page until given values are correct.
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.