After
you have created form variables, you only need to reference the
variable name in your calculations and scripts in order to obtain
the value of the variable.
Important:
When naming variables, you should avoid
using names that are identical to the names of any XML Form Object
Model properties, methods, or object names.
For information
about XML Form Object Model properties, methods, and objects, see
the
Scripting Reference.
For example, create the following form variable definitions.
Variable name
|
Value
|
firstName
|
Tony
|
lastName
|
Blue
|
age
|
32
|
In FormCalc, you can access the variable values in the same manner
that you access field and object values. In this example, the values
are assigned to three separate fields:
TextField1 = firstName
TextField2 = lastName
NumericField1 = age
You can also use variables in FormCalc functions in the same
way, as shown in this example:
Concat( "Dear ", firstName, lastName )
In JavaScript, you reference variable values by using the
.value
property instead
of the
.rawValue
property that is used for field
and object values, as shown in this example:
TextField1.rawValue = firstName.value;
Note:
Using and modifiying form variables with scripting in XFA
forms can cause the document message bar in Acrobat and Adobe Reader
to display a signature validation status warning indicating that
the signature validity is unknown due to subsequent changes to the
document.