WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Using <legend> and <fieldset> on a single drop-down.

for

From: Mark Magennis
Date: May 28, 2021 4:22AM


Hi Ksenia,

A fieldset is just a group of related fields that have a group name in addition to their individual names. So if your language dropdown is in a group of related controls then a group name might be sensible. The fieldset can have only one field in it if the group has a variable number of items in it but sometimes only one. E.g. "Color. Checkbox Red". Red is the field label and Color is the group label. But in this case there is only one color available so the group contains only one item. At other times it may also contain checkboxes for Blue, Yellow, etc.

But the group name (legend) would need to be in a group (fieldset) that it names, otherwise it doesn't name anything.

Mark

-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of Ksenia Blake
Sent: 28 May 2021 10:44
To: <EMAIL REMOVED>
Subject: [EXTERNAL] [WebAIM] Using <legend> and <fieldset> on a single drop-down.

Hi All,



I just need a bit of advice if I may. Currently we are testing a form, where a <legend> tag was used on a Language drop-down without a <fieldset>. In most websites, that I have looked, the tags, that are used to group elements, are mainly related to radio buttons and checkboxes, to combine related items. The question is, is there a specific rules of what items should be grouped and what shouldn't.



Regards,

Ksenia Blake