XFA Specification
Chapter 10, Scripting
Specifying Where to Execute a Script
322
Specifying Where to Execute a Script
Scripts may include a property (
runAt
) that specifies where the script should be executed. The possible
values for this property are as follows:
runAt value
client
(default)
server
both
Desciption
Indicates scripts that may be executed only on an XFA processing application set
up as a client.
Indicates scripts that may be executed only on an XFA processing application set
up as a server.
Indicates scripts that may be executed on either an XFA processing application
set up as either a client or a server.
Caution:
For security reasons, the server should discard any template it receives in a submitted XDP
package and obtain a fresh copy of the template from a trusted source.
The following template fragment includes a calculation that the server executes when the field value
changes or when some other event triggers the calculate event on the server:
<field …">
<calculate>
<script runAt="server">Num2Date(Date())</script>
</calculate>
</field>
Applications of the runAt="both" property
The script property
runAt="both"
is used primarily for calculations and validations. This script property
supports the follow scenarios:
Server re-calculates and re-validates submissions from the client XFA processing application.
Client XFA processing application delegates to the server scripts that it (the client) cannot perform.
That is, if the client determines that it cannot run the script, it can submit the form to the server with
instructions to execute the event. For example, the XFA plug-in for Acrobat (a client XFA processing
application) can change pages without going to the server, but the HTML client cannot. The following
template segment supports both types of client applications:
See “Submitting Data and Other Form
Content to a Server” on page 324.
Selecting a Script Language
Note:
Information on this topic will be provided in a later release of this specification.
Setting Up a Scripting Environment
Note:
Information on this topic will be provided in a later release of this specification.
Home Index Bookmark Pages
Pages: Home Index All Pages