Toggle menu

helper.focusActionButton(actionName [, label] [,fieldID])

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

ArgumentTypeDescription
actionNameString, requiredThe name of the action. Actions are described in the override function section of the Wizard Buttons article
labelString, optionalThe button label to match
fieldIDString, optionalThe 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 Buttons 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');
}

Share this page

Facebook icon Twitter icon email icon

Print

print icon