Using JavaScript

If you are unable to create a form action that meets your needs, you can include JavaScript files in custom forms and make calls to them from certain form controls. The scripts are executed when the form opens or when the form control is clicked.

JavaScripts are only executed at runtime and during form preview in SBM Composer. (By default, JavaScripts are not executed during form preview. To execute them during form preview, select the Enable JavaScripts check box in the Form Preview Dialog Box.)

Perform the following procedure if you want to use the JavaScript across forms. For a single form, use the HTMLJavaScript Widget.

To add a JavaScript file to an application:

  1. In App Explorer, open the application to which you want to add a JavaScript file.
  2. Right-click the JavaScripts heading, and select Add New JavaScript.
  3. Do one of the following:
    1. To create a new JavaScript file, type or paste the source code into the empty box.
    2. To import a JavaScript file, click Import, locate the file, and then click Open. The source code is displayed, and the path to the file is added to the Source file box.
You can use the JavaScript file when you select the following:
Note: If you change a JavaScript file and then redeploy the process app, users might not see the change at runtime, because the JavaScript file is cached in the Web browser. To see the change, users should clear the cache from their Web browser.

Related Topics