Displaying validation errors in Acrobat

Use the form validation options to control how Acrobat displays data validation errors in a PDF form.

The form validation options apply to the entire PDF form and work with other validation features like validation patterns and scripts. Before you select form validation options, apply a validation pattern or script to each field object that you want Acrobat to verify. For example, you can configure a numeric field object with a validation pattern that validates user-entered values to ensure the proper format of the number. If a user enters an invalid number, the field fails to validate. The validation pattern options define how data must be entered into a field for it to validate. The form validation options control the appearance and behavior of validation errors in Acrobat.

Designer generates a validation script for each of the validation options, except for Show Dialog Message option. The Show Dialog Message option does not generate script.

Designer monitors the validation script for any changes. If Designer detects the script is modified, it performs the following actions:

  • Stops monitoring the script and all associated scripts for that action.

  • Deselects the associated validation option on the Validation tab in the Form Properties dialog box.

  • Adds a message to the log file indicating that the script is no longer monitored and can be edited.

As long as the validation script is unchanged and managed, Designer removes the script from the form if you deselect a validation option.

Designer generates different form validation script for static and dynamic forms. As a result, when you save a form as as an Adobe XML Form (*.xdp), Designer determines which type of script to generate based on the option you select in the PDF Render Format list (Static PDF Form or Dynamic XML Form) on the Defaults tab in the Form Properties dialog box.

Note: The script that the form validation options generate overwrites any existing script that changes the appearance of field objects. The overwrite occurs when the field objects become valid or invalid. It is recommended that you customize existing scripts to store the current appearance, so that you can revert to that appearance if necessary.

It is recommended that you use the form validation options with dynamic PDF forms. However, if you are working with a static PDF form, review the recommendations you must keep in mind.

Recommendations for using form validation with static PDF forms

If you use the Form Validation feature in a static PDF form, to color mandatory fields that are not filled or fields that fail validation, Designer may change the appearance of validated fields.

As a result, when you use the Form Validation feature with a static form that contains objects with borders, it is recommended that you use only these border options on the Border tab:

  • Border Edges: Solid, Lowered-3D, Raised-3D, Dash

  • Corners: Rectangle corner

  • Background Fill Style: Solid

To configure how Acrobat displays validation error message boxes

You can configure how Acrobat displays validation error message boxes when a user fills or submits a PDF form. For example, you can choose to show each validation error message in its own box or combine all validation error messages into a single box. Alternatively, you can show only the first validation error message or no messages.

Note: Form validation options do not apply to field objects that are not configured to validate. )
  1. Select File > Form Properties and click Form Validation.

  2. Under List of Options, click Show Dialog Message.

  3. Select Configure How Acrobat Displays Validation Messages Boxes and perform one of these actions:

    • To display each new validation error message after the user closes the current message, select Show Every Message In Its Own Message Box One After The Other.

    • To combine validation errors into a single list, select Combine The Messages Of All The Failed Fields Into One Message Box.

    • To display only the first validation error message, select Show the First Failed Field’s Message And Suppress Any Other Messages.

    • To stop all validation messages, select Don’t Show Any Messages Boxes At All.

  4. Click OK.

To color fields that fail validation

You can choose different colors to highlight the borders, the background fill, or both of field objects that fail to validate in Acrobat.

Note: Form validation options do not apply to field objects that are not configured to validate. )
  1. Select File > Form Properties and click Form Validation.

  2. Under List of Options, click Color Failed Fields.

  3. Select Color Fields That Fail Their Validations and perform one or both of these actions:

    • To select a color to apply to the borders of field objects, click Border Color and select a color from the palette.

    • To select a color to apply to the background of fields objects, click Background Color and select a color from the palette.

  4. Click OK.

To color mandatory fields that are not filled

You can choose different colors to highlight the borders, the background fill, or both of mandatory field objects that the user did not fill in Acrobat.

If a mandatory field is highlighted and another script makes the field optional, highlighting is not removed.

Note: Form validation options do not apply to field objects that are not configured to validate.
  1. Select File > Form Properties and click Form Validation.

  2. Under List of Options, click Color Mandatory Fields.

  3. Select Color Mandatory Fields That Are Not Filled-In and perform one or both of these actions:

    • To select a color to apply to the borders of field objects, click Border Color and select a color from the palette.

    • To select a color to apply to the background of fields objects, click Background Color and select a color from the palette.

  4. Click OK.

To set the focus to the first field that fails validation

The Set Focus To The First Field That Fails To Validate option sets the focus to the first non-validated field in Acrobat.

The focus is set to the first invalid field in the Hierarchy palette, not the first invalid field in the geographic order. It is recommended that you order the field objects in the Hierarchy palette to match the order of the field objects in the form design. Otherwise, the focus could be set on an invalid field at the bottom of the page before one at the top of the page.

Note: Form validation options do not apply to field objects that are not configured to validate.
  1. Select File > Form Properties and click Form Validation.

  2. Under List of Options, click Set Focus.

  3. Select Set Focus To The First Field That Fails To Validate and then click OK.

// Ethnio survey code removed