6
Using Acrobat JavaScript in Forms
Forms Essentials
Guidelines for Creating a New Form
When designing a PDF form, consider first its purpose and the data it must manage. It may
be that the same page is used in multiple contexts, depending on user interactions and
decisions. In this case, there may be multiple sets of form fields. When this occurs, treat
each set of form fields as a different problem, as though each set had its own page. This will
also require extra logic applied to visibility settings. Your form design may have
dynamically changing features such as the current date, as well as convenience options
such as automatic generation of email messages. It may even have a dynamically changing
appearance and layout which is responsive to user interactions.
Usability is a major factor in the design of forms since they are essential graphical user
interfaces, so layout and clarity will be a major consideration. Finally, consider the medium
on which the form will be presented: screens with limited resolution may affect your
decisions, and printing characteristics may also be relevant.
When creating forms programmatically, consider the form elements that will be needed for
a given area. Declare those variables associated with the form elements, and apply logical
groupings to those elements that belong to the same collections, such as radio buttons or
check boxes. This will simplify the task of assigning properties, formatting options,
validation scripts, calculation scripts, and tabbing order to each of the individual form
elements.
The creation of a new form, whether done through the Acrobat layout tools or LiveCycle
ΤΜ
Designer, or programmatically through Acrobat JavaScript, will require that you consider
the following:
●
●
How the form fields will be positioned.
Which form fields will be associated in collections so that their properties can be set
with consistency and efficiency.
How size, alignment, and distribution of form fields within the document will be
determined.
When and how to set up duplicate form fields so that when the user types information
into one form field, that information automatically appears in the duplicate form fields.
When to create multiple form fields for array-based access and algorithms.
The tab order of form fields.
●
●
●
●
88
Acrobat JavaScript Scripting Guide