Adobe 12001196 - Acrobat - Mac Manual page 63

Javascript
Hide thumbs Also See for 12001196 - Acrobat - Mac:
Table of Contents

Advertisement

There are seven types of form fields, described in detail in the following sections:
Button
Check Box
Combo Box
A form field may be created either through the Form toolbar in the Acrobat UI, or by the
addField
var f = this.addField("myField", "fieldtype", 0, [100, 472, 172, 400]);
The fieldtype can be one of button, combobox, listbox, checkbox, radiobutton,
signature, or text. All of the fields except
a
Radio Button
requirements, see the
The page numbering starts with zero and the coordinates are upper-left x, upper-left y,
lower-right x and lower-right y. Thus the above line would create a field on the first page of
the document located at
points) and 1 inch high, 100 points in from the left and 400 points up from the bottom of
the page. Depending on your design requirements, check boxes are typically smaller than
this example, while text boxes can often be larger.
A default appearance is given to the field. The return value of this method is a Field object, f,
that will be used throughout the rest of this section.
In all of the Acrobat UI Field Properties dialogs, there is a checkbox labeled Locked at the
lower left corner. Checking this locks the field against being selected with the form editing
tools with a single click and thus possibly accidentally changed through the UI. When this is
checked it is still possible to edit the field properties by double clicking. Like the Close
button at the lower right of each dialog, this checkbox is only accessible through the UI and
is not available programmatically.
Note that in Acrobat 5, the form tool UI had a lot in common with the above methodology.
You created a form field and then set its type to button. In Acrobat 6, instead of a single
form field tool, there are separate tools for each type of form field. The programmatic
methodology is still the same.
The field object for a field that already exists can be obtained by the
the
var f = this.getField("myField");
For any field object, you can determine its type using the type property. For example, to
display the type of the field object f, use the command:
console.println(f.type);
Note that type is a read-only property. Contrary to what might be implied by the older
Acrobat 5 UI, you cannot change the appearance of a field by changing its type. Each field
type is a different object type.
Acrobat JavaScript Scripting Guide
method of the
Doc
requires more, to connect the multiple buttons. For details of the special
Radio Button
[100, 472, 172, 400]
Doc
Object:
Using Acrobat JavaScript in Forms
List Box
Radio Button
Object. Programmatically, a form field is created as follows:
Radio Button
section on
page
71.
; i.e., the field would be one inch wide (72
Creating form fields programmatically
Signature
Text
can be created this way. Creating
method of
getField
4
63

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Acrobat 6.0

Table of Contents