In this document, we have discussed Java Script Form Validation using a sample registration form.
The tutorial explores Java Script validation on submit with detail explanation.
It makes your page much more user-friendly, and takes out the frustration of having to fill out the same form repeatedly.
It's also very precise, as you can point out the exact field where there's a problem.
In all cases, the form is called That's checking the value's equality with a null String (two single quotes with nothing between them).
For example, if your form has a box for the user to type their email address, you might want your form handler to check that they've filled in their address before you deal with the rest of the form.
Following pictorial shows in which field, what validation we want to impose.
We will create Java Script functions (one for each input field whose value is to validate) which check whether a value submitted by user passes the validation.
Shows you how to write a script that ensures your form is filled in correctly before it's sent to your server.
Great for "required fields" such as email addresses!