JavaScript functions can be executed within a Form page in various ways, often tied to page-specific events or interactions.
You may include the JS functions within a Form Definition using the Page Functions feature.
On the Form Designer page, select Page - Functions menu option.

A pop-up window is displayed for configuration. Provide the function name and the JS in the text area as shown below.

Click the “Validate” button to validate the script. A confirmation message is displayed in the top right-hand corner. Click the Save button.

You may use the drop-down list to view the page event functions available in the Form definition, as shown below. Select the page event function to view and modify the script when necessary.

Let's associate the page event function. Select a Form control and right-click to view the Events menu option.

A pop-up window is displayed for configuration as shown below.

The Form field is selected already. You must select the control event from the drop-down list as shown below. The list of event functions available is “OnChange, OnClick, OnInit, OnKeyUp, OnKeyDown, OnMouseOver, and OnMouseOut”.

Select the page event function from the drop-down list to associate with the control event.

In this example below, the CopyThis() event function is selected and included in the Script text area as shown below.

Click the “Validate” button to validate the JS, and a confirmation message is displayed in the top right-hand corner as shown below. Click the Save button.

Generate and create a new Form instance as shown below.

As observed, selecting the Form field has triggered a CopyThis() event function, and the user input has been copied from the source to the target Form field.

You may also include the JS in the text area without creating a page event function, as shown below. Click the “Validate” button to check the script's correctness, and the Save button to confirm changes.
