PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Meaningful labels for accessibility

  1. jcollier
    Member

    I note that field names are assigned generic ID attributes, like "input_1_1" and then the label for attribute is also generic, "input_1_1".

    <label class='gfield_label' for='input_1_1'>Name</label>:
    <input name='input_1' id='input_1_1' type='text' value='' class='medium' tabindex='1'  />

    For a screen reader, I think the label is read out loud, which doesn't help identify the field.

    Is there any way to have the generated ID match the field name, even if there is a prefix or suffix to the namespace to make sure there are no collisions?

    Posted 8 years ago on Wednesday May 30, 2012 | Permalink
  2. @ jcollier -
    I'm glad to see people looking at this (pretty awesome) plugin through the accessibility lens.
    In fact, I only found your post by searching for common accessibility keywords..

    that aside, in your code snippet above, you should be OK.
    The proper way to associate the "for" attribute with an element is via 'id' and not 'name'

    Posted 7 years ago on Monday November 12, 2012 | Permalink
  3. I'll move this one to feature requests so we don't lose track of it. Thank you.

    Posted 7 years ago on Tuesday November 13, 2012 | Permalink