Used to get the value of a helper variable.
A helper variable is used to store data within the form helper. Variables are saved with a scope (see .setVariable) which defines how they behave and where they can be accessed.
If multiple forms are rendered on the same page, they can have independent variables with the same name.
Executed
Client-side and server-side.
Arguments
Argument | Type | Description |
---|---|---|
name | String, required | Name of the variable to get |
defaultValue | String, optional | A default value if the variable cannot be accessed, or has no value |
Returns
The value of the variable, undefined if the variable doesn't exist, or the default value if supplied.
Example
In this example the value of FIELD4 is being updated with the value of a variable called myVariable.
function (helper) {
helper.setFieldValue('FIELD4', helper.getVariable('myVariable'));
}
Last modified on 13 September 2023