Skip to content

DigitalA11Y

Your Accessibility Partner

  • Home
  • ServicesExpand
    • WCAG Audit Services
    • VPAT/ACR Services
    • Accessibility Consulting
    • PDF Remediation
    • Accessibility Trainings
    • Website Remediation
    • Design Audit
  • Free ToolsExpand
    • Accessibility Checker
    • A11Y Cost Calculator
    • A11Y Bookmarklets
    • Color Contrast Extension
    • WCAG Contrast Checker
  • ResourcesExpand
    • A11Y Articles
    • WCAG Primer
    • ARIA Cheatsheet
    • A11Y Tools
    • A11Y Patterns
    • A11Y Cheatsheets
  • Contact
Search
DigitalA11Y
Your Accessibility Partner
Search

Grouped Form Controls with the Too-long Legend

Grouping form controls in a meaningful way can make them much easier to handle for everyone. While most controls can be grouped, some must be grouped. The fieldset/legend structure is available for exactly that – it can even be nested. And if its visual limitations are a problem, ARIA can be of help.

<fieldset>/<legend> structures are used for grouping form controls that are related in some way. While in complex forms they can be used to group all kinds of form controls, groups of radio buttons and checkboxes should always be grouped by them.

The more complex forms are, the more it makes sense to group thematically related form controls of any kind.

Regarding <fieldset>/<legend> structures, some screen readers are much wordier than others.

On one side, JAWS attaches the <legend>‘s text to the label of each contained form control. For a <legend> with the text “Personal Details” and two fields “First Name” and “Last Name”, it literally announces:

Personal Details, First Name. Personal Details, Last Name.

On the other side, NVDA only announces the <legend>‘s text when entering the <fieldset>. For the above example, it literally announces:

Personal Details, Grouping. First Name. Last Name.

Working Example

Please fill out the following inputs truthfully and completely. We will get back to you as soon as possible. Thank you for your effort.

Explanation

By the way, it is not mandatory to group all your form controls. In the example above, you could easily drop the grouping of interests (or any other). In general: use groupings of thematically related controls whenever it feels meaningful to you and your users.

Code

  • HTML
  • CSS
  • JavaScript
<form>
  <fieldset>
    <legend>Please fill out the following inputs truthfully and completely. We will get back to you as soon as possible. Thank you for your effort.</legend>
    <div class="control">
      <label for="name">Full name</label><input id="name" type="text" />
    </div>
    <div class="control">
      <label for="biography">Biography</label><textarea id="biography"></textarea>
    </div>
    <div class="control">
      <label for="age_group">Age Group</label><select id="age_group">
        <option>
          0 to 9 Years
        </option>
        <option>
          10 to 19 Years
        </option>
        <option>
          20 to 29 Years
        </option>
        <option>
          30 to 39 Years
        </option>
        <option>
          40 to 49 Years
        </option>
        <option>
          50 to 59 Years
        </option>
        <option>
          60 to 69 Years
        </option>
        <option>
          70 to 79 Years
        </option>
        <option>
          80 to 89 Years
        </option>
        <option>
          90 to 99 Years
        </option>
      </select>
    </div>
  </fieldset>
</form>
.control, fieldset {
  margin: 6px 0;
}

label {
  display: inline-block;
  width: 120px;
  vertical-align: top;
}

input + label {
  width: auto;
}
NIL

Company

  • About
  • Blog
  • Careers
  • Contact

Services

  • Accessibility Audits
  • Accessibility Consulting
  • VPAT/ACR
  • Accessibility Trainings

Compliance

  • WCAG
  • ADA
  • Section 508
  • EN 301 549
  • EAA
  • AODA Compliance Services — Make Your Digital Assets Accessible in Ontario
  • ACA

Resources

  • Accessibility Resources
  • Understanding WCAG
  • WCAG Checklist
  • Understanding WAI-ARIA

Legal

  • Privacy Policy
  • Terms and Conditions
  • Disclaimer
  • Accessibility Statement for digitala11y.com
  • Sitemap

© 2025 DigitalA11Y
All Rights Reserved

Linkedin Twitter Facebook Instagram YouTube

DigitalA11Y
Plot No 108, 3rd Cross Rd, Saipuri Colony,
Hastinapuri Colony, Sainikpuri, Secunderabad -500094
Telangana, India.

Tel:(+91)99082 66680,
E-mail: [email protected]

Scroll to top
  • Home
  • Services
    • WCAG Audit Services
    • VPAT/ACR Services
    • Accessibility Consulting
    • PDF Remediation
    • Accessibility Trainings
    • Website Remediation
    • Design Audit
  • Free Tools
    • Accessibility Checker
    • A11Y Cost Calculator
    • A11Y Bookmarklets
    • Color Contrast Extension
    • WCAG Contrast Checker
  • Resources
    • A11Y Articles
    • WCAG Primer
    • ARIA Cheatsheet
    • A11Y Tools
    • A11Y Patterns
    • A11Y Cheatsheets
  • Contact