JavaScript action
Use the JavaScript action to access the Document Object Model (DOM) at runtime.
-
On the form modeling bar, click
Actions and click
New.
The New action dialog box is displayed.
- On the Type list, select JavaScript.
- Change the default Name (JavaScriptAction1) to something meaningful.
- Optional. Enter a Description for the action.
- Optional. Select Multilingual to configure a unique action for each language separately. See Configure multilingual actions.
- Enter the JavaScript code or reuse a Java script by pasting it in the Script box.
-
Click
Add.
The newly created action is added to the table.
-
Associate the action with the control to trigger this action. See
Configure actions for form control
events. Alternatively to call this action for a form event, associate the action with the form. See
Associate an action with a form.
Note You cannot access form elements using JavaScript from the form Onload event.
When a control triggers the action, the Java script is executed. The script has access to the DOM and is executed on the same page.
See also: