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
HTML/JavaScript Widget.
To add a JavaScript file to an application:
You can use the JavaScript file when you select the following:
- Custom form: In the
JavaScripts tab of the form Property Editor,
you can select the file from the
Add list. You can also import a JavaScript
file and include it in the form by clicking
Import. See
JavaScripts Tab of the Form Property Editor for details.
Note: You cannot directly add JavaScripts to a print form; however,
you can include JavaScript code in print form actions. Refer to
Using Form Actions.
- Button, HyperLink, or Image control: In the
URL field on the
General tab of the control Property Editor,
you can make a call to a JavaScript file. For buttons, enter the function to be
called for the
onclick event. For
HyperLink and
Image controls, create a JavaScript URL by
typing
javascript:function().
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.