Inappropriate Fieldset Element Check
Description
The “Inappropriate Fieldset Element Check” evaluates whether there is any <fieldset>
element placed outside a <form>
element.
Example outcome
I found 1 <fieldset>
element outside the form.
Impact
- Visual Impairments: Screen readers may not associate grouped inputs correctly without a proper form context, resulting in miscommunication of relationships between form controls.
- Motor Impairments: Form behavior and validation may be skipped or broken if controls aren’t enclosed in a
<form>
, causing frustration or data loss. - Cognitive Disabilities: Improperly grouped or standalone inputs might cause confusion, especially when context is lacking.
Fixes
To address inappropriately placed <fieldset>
elements:
- Locate the
<fieldset>
element. - Ensure it is nested within a valid
<form>
element.
Resources
- WCAG 2.2: Understanding Success Criteria 1.3.1
- WCAG 2.2: Understanding Success Criteria 3.3.2
- WCAG 2.2 Techniques: Technique H71: Providing a description for groups of form controls using fieldset and legend elements
- WebAIM: Semantic Structure: Regions, Headings, and Lists
- WebAIM: Creating Accessible Forms