Set focus to next element
See also: Set focus to element, Set focus to previous element
Actions – Abstract
The action Set focus to next element moves the focus in a form to the 'next' element, that matches a certain Condition.
The action Set focus to next element moves the focus in a form to the 'next' element, that matches a certain Condition (see below).
The starting point for searching the 'next' element depends on the settings for the Target element:
If no target element is linked, the focus is set to the next focusable element following the executing element.
If a target element is linked, the focus is set to the next focusable element following the linked element.
A focusable element must meet the following criteria:
The element must be of a type that is capable of receiving the focus.
The element must be 'active' and 'visible', which is the case if the options 'Active' and 'Visible' are set for the element itself as well as all of its parent containers.
The element must not be 'read only', which is the case if the option 'Read only' is not set for the element itself nor any of its parent containers.
One of the following options for Condition must be selected:
Condition |
Search criteria |
none |
Any focusable element may receive focus. |
empty |
Only an empty focusable element may receive focus. |
filled |
Only a filled focusable element may receive focus. |
empty and required |
Only a focusable element, that is empty and required may receive focus. |
►NOTE◄ If no element following the starting point (see above) in the direction of search (forward) matches the selected search criteria, the focus will stay on the current element.
Example
In an input form for shipments, a four-digit code should be entered for each package included in the shipment. A plural text attribute ('PLU code') has been introduced for this. The element 'Number of packages' serves as a synchronized numeric element of the Repeatable element for PLU codes, so that it always displays the appropriate number of input fields for 'PLU code' in the form. To provide an efficient manner for entering numerous of PLU codes, for example, with a hand-held device, the focus should automatically move on to the next input field (without requiring the Enter-key to be pressed), as soon as a valid code has been entered in a field. This functionality should enable users to conveniently enter a series of codes by typing or scanning barcodes.
After each interactive change (if applicable: after each keystroke), the Validate element behaviour checks if the entered code is valid. Validation details are defined in a Validators for the text input (not shown in screenshot).
As soon as the text input is valid, Actions on 'true' are executed. Here, Set focus to next element sets focus on the next instance of the PLU code element.
►NOTE◄ In a scenario with manual input (by typing), the option Execute later once (ms) may be useful to delay the execution of the behaviour, so that the focus does not change immediately after entering a valid code, but a correction is still possible if necessary.