Toggle menu

helper.focusField(fieldName)

Sets the focus to the specified field. The field must be on the current page. This will invoke the field's registered focus function if available.

When a form is rendered the default behaviour is to set focus to the first input field on the page. You may find, particularly when using this function in page initialisation handlers, that the default autofocus overrides focus you are trying to set. In those instances we recommend calling .disableAutoFocus first.

Arguments

ArgumentTypeDescription
fieldNameString, requiredThe name of the field

Share this page

Facebook icon Twitter icon email icon

Print

print icon