Enterprise Tookit for Acrobat Products > Mobile > (Android | iOS)

JavaScript for Acrobat Reader Mobile API Reference (iOS)

HOME | Event Class

All JavaScript scripts are executed as the result of a particular event. For each of these events, JavaScript creates an event object. During the occurrence of each event, you can access this object to get and possibly manipulate information about the current state of the event.

Properties

change

String

Defined in Event.js:34

A string specifying the change in value that the user has just typed. A JavaScript may replace part or all of this string with different characters. The change may take the form of an individual keystroke or a string of characters (for example, if a paste into the field is performed).

rc

Boolean

Defined in Event.js:55

Used for validation. Indicates whether a particular event in the event chain should succeed. Set to false to prevent a change from occurring or a value from committing. The default is true.

selEnd

Number

Defined in Event.js:88

The ending position of the current text selection during a keystroke event.

selStart

Number

Defined in Event.js:100

The starting position of the current text selection during a keystroke event.

silenceErrors

Boolean private

Defined in Event.js:112

Returns true if errors should be silenced instead of displaying an alert.

source

Object

Defined in Event.js:137

The Field object that triggered the calculation event. This object is usually different from the target of the event, which is the field that is being calculated.

target

Object

Defined in Event.js:158

The target object that triggered the event. In all mouse, focus, blur, calculate, validate, and format events, it is the Field object that triggered the event. In other events, such as page open and close, it is the Doc or this object.

targetName

String

Defined in Event.js:180

Tries to return the name of the target object. Can be used for debugging purposes to help identify the code causing exceptions to be thrown. Common values of targetName include:

The folder-level script file name for App/Init events The document-level script name forDoc/Open events The PDF file name being processed for Batch/Exec events The field name for Field events The menu item name for Menu/Exec events The screen annotation name for Screen events (multimedia events)

value

Any

Defined in Event.js:200

This property has different meanings for different field events:

For the Field/Validate event, it is the value that the field contains when it is committed. For a combo box, it is the face value, not the export value.

For a Field/Calculate event, JavaScript should set this property. It is the value that the field should take upon completion of the event.

For a Field/Format event, JavaScript should set this property. It is the value used when generating the appearance for the field. By default, it contains the value that the user has committed. For a combo box, this is the face value, not the export value.

For a Field/Keystroke event, it is the current value of the field. If modifying a text field, for example, this is the text in the text field before the keystroke is applied.

For Field/Blur and Field/Focus events, it is the current value of the field. During these two events, event.value is read only. That is, the field value cannot be changed by setting event.value.

willCommit

Boolean

Defined in Event.js:239

Verifies the current keystroke event before the data is committed. It can be used to check target form field values to verify, for example, whether character data was entered instead of numeric data. JavaScript sets this property to true after the last keystroke event and before the field is validated.


© 2013-15 Adobe Systems, Inc. All rights reserved. Use of these APIs including, the download of software, submission of comments, ideas, feature requests and techniques, and Adobe's rights to use such submitted materials, is governed by the Adobe.com Terms of Use and the Adobe Privacy Policy.