A fieldset legend was found to have an empty description
| Field | Value |
|---|---|
| Rule code | Form_LegendDescription_Missing |
| WCAG conformance level | A |
| WCAG success criterion | 1.3.1 Info and Relationships |
| Must be fixed at source | Yes |
Description
The first element inside a fieldset must be a legend element, which provides a label or description for the group of fields. We recommend avoiding nesting fieldsets unnecessarily as this can lead to confusion. Furthermore, ensure that fieldsets have non-empty legend descriptions and that each fieldset element includes a legend that describes the group of controls it encapsulates. The legend must not be visually hidden unless it serves only a decorative purpose.
How to fix
Enclose related form controls within a fieldset and use a legend for descriptions to improve accessibility; for example, <fieldset><legend>Payment Details</legend><label for="card">Credit Card:</label><input type="text" id="card" name="card"></fieldset> ensures form controls are grouped semantically and the visual layout is clear.