Once you have an HTML form up and running, you will often want to make sure that all the important fields are filled in. For example, if you are going to send an email confirmation letter, the email address should be included in the form fields, and it should be an email address that works.
There are two ways to validate your forms:
- It often appears to work faster than the CGI validation.
- Since the form page has not changed, it is easy for the reader to fix the errors.
Pros and Cons of Using CGI for Validating Forms
- Using a CGI to validate ensures that every time the form is submitted, the validation will run.
- CGI puts more load on the Web server, and every function that is included in the CGI is one more task for the server.
- CGI can be slow to run.
- If there is an error, the customer has to either go back to the first page of the form, or the CGI needs another function to rewrite the form page.
This article is part of the HTML Forms Tutorial