JavaScript action

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

  1. On the form modeling bar, click Actions and click New.

    The New action dialog box is displayed.

  2. On the Type list, select JavaScript.
  3. Change the default Name (JavaScriptAction1) to something meaningful.
  4. Optional. Enter a Description for the action.
  5. Optional. Select Multilingual to configure a unique action for each language separately. See Configure multilingual actions.
  6. Enter the JavaScript code or reuse a Java script by pasting it in the Script box.
  7. Click Save.

    The newly created action is added to the table.

  8. 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.