This function sets the focus to a button that performs the specified action. If there are multiple action buttons of the same type on the page, focus will shift to the first button that performs the action. The label and fieldID are optional but can be used to target a specific button.
Arguments
Argument | Type | Description |
---|---|---|
actionName | String, required | The name of the action. Actions are described in the override function section of the Wizard Buttons article |
label | String, optional | The button label to match |
fieldID | String, optional | The ID of the button to target |
Example
In this example focus will be set to the first FINISH (submit) button on the page.
function(helper) {
helper.focusActionButton("FINISH");
}
In this example focus will be set to the FINISH button with the label "Submit".
function(helper) {
helper.focusActionButton("FINISH", "Submit");
}
In this example focus will be set to the FINISH button of FIELD4 (eg if FIELD4 is a wizard button field).
function(helper) {
helper.focusActionButton("FINISH", helper.getFieldID("FIELD4"));
}
This function works with a button generated by the Navigation Button Helper Handlebars helper. Note how the button's identifier is used to find it within the template.
function(helper) {
helper.focusActionButton("NEXT", helper.getFieldID('MYTEMPLATE') + '_' + 'BUTTONIDENTIFIER');
}