Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date and/or time fields: inputs other than the first don't have a label #2221

Closed
avernet opened this issue May 9, 2015 · 2 comments
Closed

Comments

@avernet
Copy link
Collaborator

avernet commented May 9, 2015

This is to be fixed for:

  • xf:input bound to a node of type xs:dateTime
  • fr:dropdown-date
  • fr:fields-date

The label for the control points to the first input, but other inputs don't have a label, which is an issue per WCAG2 1.3.1 (A), reported as E885 by TotalValidator.

A label can't point to multiple form fields. Ideally, we would generate:

<fieldset>
    <legend>Birthday</legend>
    <label for="day">Day</label>
    <input id="day">
    <label for="month">Month</label>
    <input id="month">
    <label for="year">Year</label>
    <input id="year">
</fieldset>

But that might be too much of a chance and create too much trouble for styling. So instead, we could generate:

<span role="group" aria-labeledby="label">
    <span id="label">Birthday</span>
    <input id="day" title="Day">
    <input id="month" title="Month">
    <input id="year" title="Year">
</span>

Also see this article, which has more about this technique, including a link to an example, which works well for me with VoiceOver.

@avernet avernet changed the title Date and/or time fields: inputs other than the first don't have a label Date and/or time fields, radio buttons, checkboxes: inputs other than the first don't have a label May 9, 2015
@avernet avernet changed the title Date and/or time fields, radio buttons, checkboxes: inputs other than the first don't have a label Date and/or time fields: inputs other than the first don't have a label May 9, 2015
@avernet
Copy link
Collaborator Author

avernet commented Jun 7, 2015

We should first do #2219, so we can have a <span> for the label of the control.

@avernet avernet self-assigned this Nov 5, 2015
avernet added a commit that referenced this issue Nov 5, 2015
@avernet
Copy link
Collaborator Author

avernet commented Nov 5, 2015

1230ae9 and 47b9c41 take care of adding titles for the fr:dropdown-date and fr:fields-date. For the xf:input, we need to figure where the resources should come from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant