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
Argument | Type | Description |
---|---|---|
fieldName | String, required | The name of the field |