This article assumes a general understanding of HTML and Java Script.
(16 printed pages) Introduction Getting Started Writing the Validation Script Connecting the Form to the Script Associating Form Fields with Custom Script Code Listing Conclusion When you create forms, providing form validation is useful to ensure that your customers enter valid and complete data.
The idea is to create a set of “validation descriptors” associated with each element in a form.
The “validation descriptor” is nothing but a string specifying the type of validation to be performed.
In other words if the first condition fails, the second condition will not be tested and so forth.
Only when all conditions have been satisfied do we reach the command, in which case the form will be submitted.
This tutorial will show you how to create a Java Script-enabled form that checks whether a user has filled in the form correctly before it's sent to the server. First we'll explain why form validation is a useful thing, and then build up a simple example form, explaining things as we go along.
At the end, there's a little exercise to keep you busy too!