Applies to:
- Winshuttle Foundation
Winshuttle Composer JavaScript reference guide
JavaScript reference guides
The Winshuttle Composer rules interface uses the Web browser's JavaScript engine. The Composer Rule Wizard defines built-in rules, which are then converted to JavaScript when the form is run.
But if the Composer Rule Wizard still does not meet your needs, you can create and customize specific functions through advanced JavaScript rules, which are generally divided among the following:
Function type |
Description |
Form Functions |
General form functions used to manipulate form fields and elements, such as creating or hiding groups, reloading dropdown options, setting values in fields, and more. |
Workflow functions | Functions generally used and applied to Workflow Transitions to control workflow logic. |
Global Helper Functions | More discreet functions generally used to manipulate data in fields, and perform tasks such as converting text from upper case to lower case, averaging a set of values, returning the number of values in a repeating group, etc. |
JQuery Functions | A small set of helper functions that can be used by JQuery users. |
Important Notes - Please Read
|
Adding custom JavaScript/CSS to a form
The Composer solution tree has two nodes where custom JavaScript Code and Custom CSS (Styles) are stored.
You can also right-click a node to open the context menu, and edit the JavaScript/CSS references. The References dialogs allow you to insert links to JavaScript files or CSS files from any URL.
|
|
Accessing form field values
To access or modify a field, use $form.getValue and $form.setValue in the form.
You should not access DOM elements directly to manipulate the values. Doing so will disrupt proper event handling and rules propagation within the form renderer.
Using jQuery
The form renderer uses jQuery, which is available for use within rules.
Instead of using $ to access jQuery functionality, you should use the alias $j or use the full jQuery function name.