This object represents an
Before a field can be accessed, it must be bound to a JavaScript variable through a method provided by the Doc. More than one variable may be bound to a field by modifying the field’s object properties or accessing its methods. This affects all variables bound to that field.
var f = this.getField("Total");
This example allows the script to manipulate the form field “Total” by means of the variable f.
Fields can be arranged hierarchically within a document. For example, form fields with names like “FirstName” and “LastName” are called flat names and there is no association between them. By changing the field names, a hierarchy of fields within the document can be created.
For example, “Name.First” and “Name.Last” forms a tree of fields. The period (‘.’) separator in
Each presentation of a terminal field is referred to as a widget. An individual widget does not have a name but is identified by index (0-based) within its terminal field. The index is determined by the order in which the individual widgets of this field were created (and is unaffected by tab-order).
You can determine the index for a specific widget by using the Fields navigation tab in
Beginning with
Beginning with Acrobat 8.0, the LiveCycle Reader Extensions Field right is checked for Field objects only if the JavaScript code is executed outside the PDF file (from the JavaScript console, through batch execution, or through JSObject).
Action |
Field object that represents all |
Field object that represents one specific widget |
---|---|---|
Get a widget property |
Gets the property of widget # 0. |
Gets the property of the widget. |
Set a widget property |
Sets the property of all widgets that are children of that field. |
Sets the property of the widget. |
Get a field property |
Gets the property of the field. |
Gets the property of the parent field. |
Set a field property |
Sets the property of the field. |
Sets the property of the parent field. |
The following example changes the rect property of the second radio button (the first would have index 0) of the field “my radio”.
var f = this.getField("my radio.1");
f.rect = [360, 677, 392, 646];