Skip to main content
Version: v6

A fieldset legend was found to have an empty description

A fieldset legend was found to have an empty description — rule summary
FieldValue
Rule codeForm_LegendDescription_Missing
WCAG conformance levelA
WCAG success criterion1.3.1 Info and Relationships
Must be fixed at sourceYes

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.