scriptTest

Controls validation by the enclosed script.

Scripts specified as part of a validation should make no assumptions as to how the processing application might use the validation results, or when the validate object is invoked. In particular, the script should not attempt to provide feedback to a user or alter the state of the form in any way.

The scriptTest property can be used for validations. The scriptTest property is not evaluated on null fields. The scriptTest property can be an evaluated context during the lifetime of a form, such as when focus leaves a field.

Syntax

Reference_Syntax.scriptTest = "error | disabled | warning"

Values

Type

Values

String

  • disabled

  • error (default)

  • warning

  • dismiss: The user understands the message and wants to return to the form to satisfy this constraint.

  • override: The user understands the message, but chooses to contravene this constraint.

Do not perform this test. The form object is permitted to have a value that does not conform to the script. The field can be left with a non-conforming value, and it will not negatively affect the validity of the form. This value disables the validation test.

  • error (default)

  • warning

  • dismiss: The user understands the message and wants to return to the form to satisfy this constraint.

  • override: The user understands the message, but chooses to contravene this constraint.

Emit a message and refuse to accept data that the script reports is erroneous. The form object is required to have a value that conforms to the script.

  • warning

  • dismiss: The user understands the message and wants to return to the form to satisfy this constraint.

  • override: The user understands the message, but chooses to contravene this constraint.

Emit a message if the script reports the data is erroneous but allow the user to proceed to the next field. The message must inform the user that the form object is recommended to have a value that conforms to the script’s constraints, and provide two choices:

  • dismiss: The user understands the message and wants to return to the form to satisfy this constraint.

  • override: The user understands the message, but chooses to contravene this constraint.

Applies to

Version

XFA 2.1

Examples

JavaScript

NumericField1.validate.scriptTest = "disabled";

FormCalc

NumericField1.validate.scriptTest = "disabled"

// Ethnio survey code removed