Specifies whether an item, page, or form currently has the input focus. This option is usually set by code outside XFDL, but can also be set by a compute, provided that the compute is setting the focus of an item to on, the item is on the same page, and the item receiving the focus is capable of doing so.
This option is not saved or transmitted as part of the form. Instead, it is automatically created each time the form is read into memory, and is maintained only during display or processing.
<focused>status</focused>
Parameter | Type | Description |
---|---|---|
status | on | item, page, or form has input focus. |
off | item, page, or form does not have input focus. |
button, check, checkgroup, combobox, field, list, popup, radio, radiogroup, richtext, slider, page global, form global
The following example shows a button that changes its color to white if it has the input focus, and to blue if it does not.
<button sid="saveButton">
<type>saveas</type>
<value>Save</value>
<focused>off</focused>
<bgcolor compute="focused=='on' ? 'white' : 'blue'"></bgcolor>
</button>
The following example shows how the focus can be moved to a different item based on user input.
<check sid="CHECK1">
<value>off<value>
<label>Check here to skip next section</label>
<custom:myoption compute="toggle(value, 'off', 'on') == 

'1' ? set('FIELD14.focused','on'): ''"></custom:myoption>
</check>