XFA Specification
Chapter 9, Automation Objects
Validations
299
Result
The processing application uses the result of executing the calculation script as described below:
Parent element
field
exclGroup
Result destination in the parent element
Replaces the value of the
field
container element.
Replaces the value of the
exclGroup
container element. This action has the
side effect of changing the state and value of the fields contained in the
exclusion group.
subform
elements do not have explicit values; however the result of a subform
calculate
script can be used to initiate some other function unrelated to
setting a value.
subform
Validations
This section describes the nature of validation, what types of tests are included in validation, when
validation is done, and how an interactive XFA processing application interacts with a user when validation
fails.
Validation allows a template designer to specify a set of tests to be performed on a field, subform, or
exclusion group. As with calculations, validation tests are triggered by changes to the field, subform, or
exclusion group.
About
As compared to UI validation
In an interactive context, the UI may perform some validation. For example, a numeric edit widget will not
accept letters of the alphabet as input. However this type of validation does not apply to non-interactive
applications, because they have no UI. Furthermore, this type of validation is quite limited. It cannot, for
example, compare the numeric content of two fields to validate that one is larger than the other.
Validation scripts provide a mechanism to perform validations that are more intelligent and that,
optionally, apply in non-interactive as well as interactive contexts.
As compared to XML validation
XFA validation differs from XML validation, in the following ways:
Type of testing.
While some XFA validation tests have counterparts in XML validation, XFA validation
also supports scripted tests. Such tests support highly specific validation for containers that can
consider the values of other fields.
Activation of tests.
Activation of XFA validation for specific container may be independent of activation
for validation in other containers and may be triggered at various stages in the life of the a form. For
example, XFA validation may be done at all of the following stages: when the focus leaves a field (after
data is entered), when a button is clicked, and when the form is committed.
In contrast, XML validation is an all-or-none endeavor and would be performed just before committing
the form. Unfortunately, such errors occur too late in the form’s life for a user to respond. Consider a
user’s response to being pelted with numerous validation error messages, when attempting to commit
(submit) a form with numerous inter-related fields.
Home Index Bookmark Pages
Pages: Home Index All Pages