Form Data Validation
Form Data Validation
Form data validation comes in a couple different forms. Data can be validated at the field level when it is entered by the user, and it can be validated at the form level (i.e. all fields) when the form is submitted or printed. These different types of validation have different, complimentary purposes and for a complete form design it's a good practice to use a combination of the two methods.
Field Level Validation
The purpose of Field Level Validation is to verify that the input to a single field is entered correctly. For example, for an email field, the job of the validation script is to make sure the entered text matches the standard email format, i.e., two sets of strings separated by an "@" symbol. The most common way to implement a text pattern test like this is to use a Regular Expression. In fact, this example is fairly typical. Most of the time validation scripts are used to match input text against a pattern using a regular expression. But of course, this is not the only way to implement a validation script and it's not the only thing a validation script can be used for.
After testing the input data the Validate Script can completely reject an entered value, alert the user to a problem, and even modify the entered value before it is committed to the field. It can also be used creatively for non-validation purposes. So there is quite a bit of flexibility in how this event can be used.
Find out more about the Validate Event from the Articles at the bottom of the page, and from these videos:
Form Level Validation
Form level validation is used to ensure all the required form data is filled in, and/or to make sure that any data dependencies between fields are met before the form is submitted. Usually, this type of validation uses a much simpler data test than field level validation because it's assumed that field level validation guarantees any entered data is correct.
If you've filled out a form on a web page then you've seen this in action. On a web page, the required fields are usually indicated with a red "*". And if you don't fill one out, then on submit you'll get the same page back with a warning message at the top telling you to fill out the marked fields. In Acrobat, it's a little different. You can certainly do this check on a submit, but since PDF documents are standalone, i.e., they can be returned by printing or by file transfer, you may also want to do form level validation when the form is saved or printed.
There is a great deal of flexibility to how form level validation is used. To find out more see the articles listed below.