To attach a JavaScript script to an object

You can add a JavaScript script to any form design object that allows calculations and scripts, including the script object.

  1. Make sure that you have the multiline version of the Script Editor displayed in the Designer workspace.

  2. Select a field on your form. For example, add a new text field to your form design.

  3. In the Show list, select a valid event. For example, using the new text field, select the docReady event.

  4. In the Run At list, select where you want the script to execute. For example, for the new text field, select Client.

  5. Click the Functions icon  or F10 to display a list of JavaScript functions.

  6. Select the desired function, and press Enter.

  7. Replace the default function syntax notation with your own set of values. Alternatively, you can create your own script manually in the Script Source field of the Script Editor. For example, in the new text field, add the following JavaScript to the Script Source field:

    this.border.fill.color.value = "255,0,0";

  8. Click the Preview PDF tab to test the form. The text appears red for the new button object when the form is displayed in the Preview PDF tab.

// Ethnio survey code removed