Nested Fieldsets

Nested Fieldsets

WCAG Focus: WCAG 1.3.1 (A) · Usability

Complex checkout or multi-step WordPress forms sometimes place a <fieldset> for "Shipping Address" inside another <fieldset> for "Customer Information". Screen readers frequently concatenate every ancestor <legend> before reading each individual input, creating long, repetitive audio announcements.

Why This Pattern Violates WCAG

WCAG 1.3.1 Info and Relationships (Level A) works best when form sections use semantic headings (<h2>, <h3>) for broad sections and flat, non-nested <fieldset>/<legend> wrappers strictly for tightly coupled radio or checkbox groups.

Code Comparison

Noisy Nested Fieldsets

<fieldset>
  <legend>Order Details</legend>
  <fieldset>
    <legend>Delivery Speed</legend>
    <label><input type="radio" name="ship"> Standard</label>
  </fieldset>
</fieldset>

Compliant Flat Section Heading + Single Fieldset

<h3>Order Details</h3>
<fieldset>
  <legend>Delivery Speed</legend>
  <label><input type="radio" name="ship"> Standard</label>
</fieldset>

How to Fix It in WordPress

  • Replace outer wrapper <fieldset> tags with <section> or <div> elements headed by an appropriate <h2>/<h3>.
  • Keep <fieldset> flat around individual radio/checkbox groups or compact related inputs like Date of Birth.

Finding This Issue Automatically

Multi-section form builders often nest <fieldset> blocks automatically inside wrapper containers. Running the WP ADA Compliance Check plugin flags nested fieldsets so your forms remain crisp and easy to listen through in a screen reader.

WCAG References & Supporting Materials

WCAG Success Criteria

Supporting Documentation & Guides

Subscribe

Subscribe to receive daily Web Accessibility - Did you know? articles in your inbox.

Cart Accessibility Tools
hide