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.
Item Index
Properties
Properties
change
String
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
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
The ending position of the current text selection during a keystroke event.
selStart
Number
The starting position of the current text selection during a keystroke event.
silenceErrors
Boolean
private
Returns true if errors should be silenced instead of displaying an alert.
source
Object
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
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
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
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
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.