Adobe acrobat forms javascript object specification 用户手册

下载
页码 64
Acrobat Forms - JavaScript Object Specification
39
var a = this.getField("newItem");
var b = this.getField("oldItem");
a.calcOrderIndex = b.calcOrderIndex + 1;
In this example, the
method getField, gets the newItem field that was added after
oldItem’ field. It then changes the calcOrderIndex of the oldItem field so that it is calculated
before ‘newItem’ field.
charLimit
Type: Integer
Fields: Text
Access: R/W
This property limits the number of characters that a user can type into a text field.
defaultValue
Type: String
Fields: All but Button
Access: R/W
This property exposes the default value of a field. This is the value that the field is set to when
the form is reset.
delay
Type: Boolean
Fields: All
Access: R/W
This property delays the redrawing of a field’s appearance. It is generally used to buffer a
series of changes to the properties of the field before requesting that the field regenerate its
appearance. Setting the property to true forces the field to wait until delay is set to false. The
update of its appearance then takes place, redrawing the field with its latest settings.
// Get the MyCheckBox field
var f = this.getField("MyCheckBox");
// set the delay and change the fields properties
// to beveled edge and medium thickness line.
f.delay = true;
f.borderStyle = border.b;
f.strokeWidth = 2;
// force the changes now
f.delay = false;
There is a corresponding document level
flag if changes are being made to many fields at
once.