Add a JavaScript action
Use the JavaScript action to access the Document Object Model (DOM) at runtime.
- On the Form Modeling bar, click Actions.
-
On the
Actions page, click
Add
.
- On the Type list, select JavaScript.
- Enter a Name and Description for the action.
- Optionally, configure a unique action for each language separately. See Configure multilingual actions for a form or control for more information.
- Enter the JavaScript code or reuse a Java script by pasting it in the Script box.
-
Click
OK.
The newly created action appears in the Actions table.
- Click Save.
-
Associate the action with the control to trigger the action. For
more information, see
Associate an action with a form or
control
Note You cannot access form elements using JavaScript from the form Onload event.
When a control triggers the action, the JavaScript is executed. The script has access to the DOM and is executed on the same page.