Fieldsets
Last updated on
13 April 2018
Use when
- There are a lot of form elements which need to be grouped logically
- There are very different form elements on a page
- There are very similar form elements, but with a distinctive difference
Recommendations
- Don't put a fieldset around the main (first) interaction on the page if there is one
- Keep the label short and concrete
- Fieldset contents should stay within one page scroll
- Avoid nested fieldsets, it disorients the user
- Position default-collapsed fieldsets below expanded ones
- If a fieldset is collapsible, the default state should be collapsed (if it's that important to show its content initially, don't make it collapsible)
Problem
Pages with a lot of form elements without grouping and hierarchy are confusing and hard to use and get used to. Some form elements are not important enough to see all the time.
Solution
Group related form elements with a fieldset.
A fieldset is placed around these form elements. The fieldset can be made collapsable.

Drupal 8 - When to use Details over Fieldsets
- When you are looking to visually organize a group of form elements.
API
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.