It could also be used to connect fields for a day, a month and a year for individual input fields to select a specific date (as seen in the first example), as well as hours and minutes to select a time (if native date and time pickers aren't an option). Or you could have different fields for a credit card number by splitting them into four digits each. You see, there are many possibilities to use fieldset
elements, just don’t overuse them – because with many possibilities comes great responsibility – or so.
Make also sure to always test your fieldset
elements with a screen reader to see whether adding a context in such a way is useful. This will make it easier to distinguish whether you should use a fieldset
or better use non-connected single form fields.
Matthias is a passionate full stack web developer and responsible for the technical aspects on more than 1.000 websites, including performance, reliability, accessibility and functionality. That’s why he is very interested in many things around the web, and has a big focus on building inclusive web applications and websites.
Blog: epiph.yt