validate event

Description

Initiates when the form design and data merge to create your form and when a field loses focus; for example, when a form filler clicks or uses the Tab key to exit a field. This event initiates again each time the value of a field changes. Calculations and scripts placed on the validate event provide a method to perform validations that are more specific than those available through the Value tab of the Object palette.

Calculations and scripts on the validate event are required to return true or false (expressed in a format appropriate to the scripting language) corresponding to a validation that succeeds or fails, and must not affect the overall form structure of form values. In addition, calculations and scripts should not attempt to provide feedback to a form filler because that form filler may not be using the form in a client application such as Acrobat.

Note: Because validations are performed against the content of the form, they cannot be used to verify presentation formatting caused by field patterns.

Type

Processing event

Support

Client application

Availability

Acrobat and Adobe Reader

yes

HTML browser

yes

Version

XFA 2.1

Example

You can use this event to verify object values, particularly in situations where object data must conform to specific rules. For example, you can create a script on the validate event to verify that a total cost field on a purchase order form does not have a negative value.

For a detailed example of using the validate event, see Setting a field as required at run time .

// Ethnio survey code removed