Skip to content

Instantly share code, notes, and snippets.

@Stanton
Last active May 11, 2018 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stanton/9c9f75a9ce3dad8a1db116c758aa79ad to your computer and use it in GitHub Desktop.
Save Stanton/9c9f75a9ce3dad8a1db116c758aa79ad to your computer and use it in GitHub Desktop.

Given the following markup:

<fieldset id="comp-1">
    <legend id="comp-1[label]">Legend One</legend>    
    <label for="dd-1" id="dd-1[label]">Day</label>
    <input id="dd-1" type="text" />
</fieldset>

<fieldset id="comp-2">
    <legend id="comp-2[label]">Legend Two</legend>    
    <label for="dd-2" id="dd-2[label]">Day</label>
    <input id="dd-2" type="text" />
</fieldset>

Both instances throw the following error:

Error / priority 100% This field label is not unique.

Web Content Accessibility Guidelines (WCAG) 2.0, Level AA: 2.4.6 Headings and Labels

These field labels have identical text. Make sure that fields have unique labels. If you have a legitimate reason to reuse the label text, make sure that the different fields are grouped appropriately using a &lt;fieldset&gt;.

Should this still be flagged as an error when the actual guidance is already being followed (grouping by fieldset)?

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