What does this mean?
Radio buttons or checkboxes have been found without a containing fieldset to group them.
Impact on users
As radio buttons and checkboxes are typically used to present a series of options to a user, grouping those options helps the user understand that they are related and in the case of radios that only one option in that group can be chosen.
The fieldset grouping also carries an accessible name for the group via the legend element which adds context and may be integral to the understanding of the options.
If the legend is present but the fieldset is not then the legend will be interpreted as plain text and not programmatically associated with the options (important for screen-reader users).
For example without the fieldset the legend is not associated with the radios so the user has to make that connection themselves and they will also need to decide which fields belong together in the group:
<legend>How do you want to be contacted?</legend>
<input type="radio" ...>
<label for="phone">Phone</label>
<input type="radio" ...>
<label for="email">Email</label>
<input type="radio" ...>
<label for="post">Post</label>
How to fix
Always wrap radio and checkbox groups with a fieldset to programmatically set the group. The first element inside the fieldset should be the legend.
Make sure the fieldset has a legend to provide the accessible name. Without an accessible name the fieldset may be ignored by screen-readers.
For example:
<fieldset>
<legend>How do you want to be contacted?</legend>
<input type="radio" ...>
<label for="phone">Phone</label>
<input type="radio" ...>
<label for="email">Email</label>
<input type="radio" ...>
<label for="post">Post</label>
</fieldset>
References
- Fieldset guidance - GOV.UK
- Checkbox guidance - GOV.UK
- Radio guidance - GOV.UK
- How screen-readers work with grouped fields:
- Fieldsets, legend and screen-readers again - TPGi
- Use legend and fieldset - Adrian Roselli