The XML file script can contain functions to handle user actions and to respond to these actions. JavaScript listener functions for field changes support user actions (type a character, select from a combo, and so on). The Form Editor invokes listener functions whenever a change is detected in the corresponding form field, and these functions respond to changes in field values by updating the values of other fields.
Use the following naming convention to define listener functions for field changed events:
function [FIELDNAME]Changed
Follow these steps:
The form definition appears in the text editor.
For example, if a form includes an mrapplication field, you can define a listener function that responds to its changes as follows:
<events language="javascript">
function mrapplicationChanged()
{
editor.setTextFieldValue("mrdocument", editor.getTextFieldValue("mrapplication"));
}
</events>
function formOpened()
{
editor.alert("JavaScript formOpened Event");
}
The form field is defined to handle user actions.
|
Copyright © 2013 CA.
All rights reserved.
|
|