Almost all internet users like you & me are signed up or registered in various sites. This process is little bit intelligent & guide us to provide right type of information. I think it will help the beginners a lot & others can modify/customize according to their requirement.
On submit this code will check if “first name” is filled in or left blank mistakenly.
If the data entered by a client was incorrect or was simply missing, the server would have to send all the data back to the client and request that the form be resubmitted with correct information.
This was really a lengthy process which used to put a lot of burden on the server.
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!
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.
You can then adapt this form to your own requirements.
Let's build a simple form with a validation script.
The following example shows how to validate an entered email address.