Core Form Controls

Release 2.0 - ...

Form controls are declared using markup elements, and their behavior refined via markup attributes.

The core form controls are described in this section, including their attributes and their content models (their metadata elements). A core form control is an element that acts as a direct point of user interaction and often provides read, write, or read/write access to a node of instance data.

XForms Core Form Controls

The table below shows an overview of these controls.

Core Form Control Element Attributes Minimal Content Model
input Common, Single Node Binding, UI Common, incremental label, UI Common
secret Common, Single Node Binding, UI Common, incremental label, UI Common
textarea Common, Single Node Binding, UI Common, incremental label, UI Common
output Common, Single Node Binding (optional), appearance, value, mediatype label (optional), mediatype (optional), UI Common
upload Common, Single Node Binding, UI Common, mediatype, incremental label, mediatype (optional), filename (optional), UI Common
range Common, Single Node Binding, UI Common, start, end, step, incremental label, UI Common
trigger Common, Single Node Binding (optional), UI Common label, UI Common
submit Common, Single Node Binding (optional), UI Common, submission label, UI Common
select Common, Single Node Binding, UI Common, selection, incremental label, List UI CommonUI Common
select1 Common, Single Node Binding, UI Common, selection, incremental label, List UI Common, UI Common

For all Core Form Control elements, the label element is required, unless stated otherwise.
Elements from the UI Common group are always optional.

Attributes from the Common Attributes group and the UI Common Attributes group are always optional.
Attributes from the Single Node Binding Attributes group are always required, unless stated otherwise.

The incremental attribute is of type xsd:boolean (true | false) and is always optional.

Common Support Elements

The table below shows an overview of additional support elements for form controls.

Support Element Attributes Minimal Content Model
label Common, Single Node Binding (optional) PCDATA | UI Content
help Common, Single Node Binding (optional) PCDATA | UI Content
hint Common, Single Node Binding (optional) PCDATA | UI Content
alert Common, Single Node Binding (optional) PCDATA | UI Content
filename (for upload) Common, Single Node Binding EMPTY
mediatype (for upload) Common, Single Node Binding EMPTY
mediatype (for output) Common, Single Node Binding, value EMPTY
choices (for selection controls) Common label (optional), List UI Common
item (for selection controls) Common label, value, UI Common
value (for selection controls) Common, Single Node Binding (optional) PCDATA

 

Content Sets

The following content sets are used.

UI Common

The UI Common set contains the common support elements help, hint and alert as well as any element from the Action content set.

List UI Common

The List UI Common set contains the choices, item and itemset elements.

UI Content

The UI Content set allows zero or more output elements as well as a set of elements from the xhtml namespace.

PCDATA

Several of the support elements allow text as content. This is indicated by the term PCDATA, which means parsed character data.

Specification

Link to the XForms specification: Core Form Controls.

Topics