orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 221 forks source link

XForms support for multiple labels #4758

Open avernet opened 3 years ago

avernet commented 3 years ago

Currently, we support external labels, as in:

<xf:label for="my-input">Address</xf:label>
<xf:input ref="name" id="my-input"/>

But we don't support having several such external labels. For instance we don't have a way to tie the labels "Billing" and the label "Address" to the input field in:

<xf:label>Billing</xf:label>
<xf:label>Address</xf:label>
<xf:input ref="name" id="my-input"/>

We could do this either by supporting multiple labels points to a single field, or by supporting a way for fields to point to their labels. The latter technique seems preferable as it allows the form author to specify an order for the labels. Also, it is in line with what is being done in HTML. If we name the attribute labeled-by, the above example with the input field pointing to the two labels would look like:

<xf:label id="billing-label">Billing</xf:label>
<xf:label id="address-label">Address</xf:label>
<xf:input ref="name" labeled-by="billing-label address-label"/>
ebruchez commented 1 year ago

Changing the title to reflect the fact that we might want to support a combination of (probably a single) internal and external labels for #4491.