SCRIPT element
The SCRIPT element defines an exit point to allow the invocation of a script (JavaScript) in response to an event. Scripts are supported for pages, read-write fields and action controls. These elements are not applicable and not supported for fields within a LIST or read-only fields.
Attributes
The SCRIPT element has the following attributes:
|
Attribute Name |
Required |
Default |
Description |
|---|---|---|---|
|
EVENT |
Yes |
The JavaScript name of the event as defined in the W3C HTML recommendations. JavaScript events are valid within the PAGE, FIELD or ACTION_CONTROL elements, with the exception of FIELD elements within a LIST or read-only FIELD elements. Note that the ONCLICK event will be ignored for ACTION_CONTROL with a TYPE of CLIPBOARD. For more further information, see the ACTION_CONTROL element. In addition, by default when a link is clicked in the Cúram application the link is processed by Cúram specific code. If you are adding some scripting to a link and do not want this default processing to occur, the event should be stopped using the JavaScript APIs available. |
|
|
ACTION |
Yes |
The JavaScript to be invoked if the event occurs. This must be a function call including parameters, if any. For example; someFunction() or someFunction(someParam) where someParam may be a global variable defined in script file. |
|
|
SCRIPT_FILE |
No |
The name of the script file containing the JavaScript functions that are specified in the ACTION attribute of the SCRIPT element. If no SCRIPT_FILE attribute is set on a particular SCRIPT element within a FIELD or ACTION_CONTROL the PAGE script file is used by default. The script file should be added in a component. If another script file has the same name in another component, the version in the highest priority component will be used. If not specified, the SCRIPT will expect to find the functions in the page-level script file specified with the PAGE element's SCRIPT_FILE attribute. |
|
|
EXPRESSION |
No | The name of the a JavaScript function identifier (excluding the parenthesis) that will be used to evaluate whether a dynamic conditional cluster will be displayed or not. The name should ideally reflect the encapsulated logic within the function. |
Child elements
The SCRIPT element contains no child elements.