About data validation

Microsoft Office InfoPath

Show All Show All

About data validation

Data validation can be used to display error alerts when users enter incorrect values into a form. Rather than checking for errors after a form is completed, data validation verifies values as the form is being filled out.

Working with data validation when filling out a form

Microsoft Office InfoPath 2003 automatically checks the data you type into a form and displays an error alert if the value does not match the condition specified by the data validation rule. The most common types of data validation include required entries, where you must enter a value; range checking, where the value you enter must fall into a certain range; and data types, where the value you enter must be a certain type, such as a number or date. If a value you enter does not match the specified condition, an error alert provides you with immediate feedback.

Error alerts can be either dialog box alerts or inline alerts. You can correct errors immediately, or you can use the commands on the Tools menu to navigate through and correct all the errors in a form at one time. Uncorrected errors are marked with a dashed red border or, for required entries, a red asterisk. If you save a form without fixing the errors, you will be reminded about the errors with a dialog box alert. You can save forms with validation errors, but you cannot submit them to a database or Web service.

Working with data validation when designing a form

Data validation is always associated with a specific control and occurs when a user fills out a form. Note that Office InfoPath 2003 verifies a condition by checking the value of the field that is bound to the control, not the control itself.

ShowTypes of data validation

ShowTypes of error alerts

ShowSchema-based validation

To test a data validation constraint, including the conditions and error alerts, you can preview your form and enter valid and invalid data into the control you want to test. Error alerts will appear in the preview exactly as they appear to your users.

Note  Conditional formatting is another effective way of responding to data entry. If you prefer to notify users with changes in color or text formatting, and you do not need to show an error alert, you can use conditional formatting for range checking and dynamic comparisons.