Add a JavaScript action

Use the JavaScript action to access the Document Object Model (DOM) at runtime.

  1. On the Form Modeling bar, click Actions.
  2. On the Actions page, click Add Generic Add.
  3. On the Type list, select JavaScript.
  4. Enter a Name and Description for the action.
  5. Optionally, configure a unique action for each language separately. See Configure multilingual actions for a form or control for more information.
  6. Enter the JavaScript code or reuse a Java script by pasting it in the Script box.
  7. Click OK.

    The newly created action appears in the Actions table.

  8. Click Save.
  9. 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.