🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 20, 2026

How to Group Fields in Gravity Forms with a Styled Fieldset

GravityExtra
How to Group Fields in Gravity Forms with a Styled Fieldset

A form with twenty fields is not hard to build. It is hard to fill in. When name, email, phone number, street address, delivery notes, billing details and a message all sit in one long column, visitors lose their place, skip questions and leave. The fix is not always more pages. Often the fix is structure: put the questions that belong together in a box, give the box a title, and let the eye do the rest.

This guide shows how to group fields in Gravity Forms with a real container instead of a simple heading. It uses the Gravity Forms Field Group Container add-on, but the ideas apply to any long form: when to group, how to label a group, how to lay out the fields inside, and how to hide a whole group without breaking validation.

The Gravity Forms form editor with a Group Start field called Contact details selected: the four fields below it (email, phone, street address and city) have a blue edge on the left, a Group End field closes the group, and the Field Settings on the right show the group box settings Style Card, Columns 2, Icon Mail, Padding 28 and the border, background and legend colours
The form editor: fields between Group Start and Group End get a blue edge, and the group box settings sit in Field Settings.

Why a heading is not enough

Gravity Forms already has a Section field. It adds a title and a line to the form, and that helps a little. But a Section is only a heading: nothing is wrapped. The fields below it are still loose siblings in the form. You cannot give the section a background, you cannot put the fields in columns that differ from the rest of the form, and a screen reader does not know that the five fields below belong together.

A Page break is the other tool. It splits the form into steps, which is great for forms with many questions, but it is heavy for a form with twelve. Every page break is a click, a reload on non-AJAX forms, and a chance to leave. If you only want to show that the shipping address is different from the billing address, a page is overkill.

What you want is a container: a box that holds a set of fields, has a visible title, and can be styled as one thing. In HTML the right element for this has existed for a long time. It is called a fieldset, and its title is a legend. Browsers and screen readers understand it: when someone moves into a fieldset, assistive technology announces the legend, so the person knows they are in the shipping address group before they hear a single field label.

Step 1: decide what belongs together

Before you touch the editor, read the form like a visitor. Which questions answer the same question? A few groupings that work in almost every form:

  • Contact details: name, email, phone number.
  • Address: street, city, postcode, country.
  • About the request: the dropdowns and text that describe what the visitor wants.
  • Optional extras: anything the visitor can skip, such as a second contact person or a company VAT number.
  • Payment or billing: everything that is only needed to take the money.

Three to five groups is plenty. If every field has its own box you have only moved the clutter around. And leave the most important question, usually the message or the one thing the form exists for, outside any group, so it is not hidden inside a frame.

Step 2: add the group fields

With the add-on active, two new fields appear in the Advanced Fields panel of the form editor: Group Start and Group End. Drag a Group Start to the place where the box should begin, add the fields that belong in it, and close the box with a Group End. In the editor, the fields in between get a coloured edge on the left, so the structure is easy to see while you work.

Why two fields and not a single container field? Because Gravity Forms builds forms as a flat list of fields, and the editor is built around dragging them. With a start and an end marker you keep that flat list: you can move a field in or out of the box by dragging it across the marker, and you can see exactly where each box begins and ends. The add-on pairs the markers for you, one start with the nearest end after it.

The label of the Group Start becomes the legend. Choose a short, plain title such as Contact details or Delivery address. If a group needs a sentence of help, put it in the description of the Group Start; it appears right under the legend and is read together with it by screen readers.

Step 3: pick a style that fits your site

A form on the site with four group boxes one under the other: Card group with a user icon and a soft shadow, Outline group with a home icon and the legend sitting in the border, Shaded group with a calendar icon on a pale blue background, and Plain group with only a heading and a line under it
The four presets: Card, Outline, Shaded and Plain.

The add-on has four presets, and each one suits a different kind of form.

  • Card is a white box with a soft border and shadow. It is the safest choice for forms on a plain background and makes each group feel like a small panel.
  • Outline draws a stronger border and puts the legend into the border, like the classic fieldset look. It works well for formal forms such as applications.
  • Shaded uses a pale background and no border. It is calm and works nicely on white pages when you do not want lines.
  • Plain has no box at all: only the title with a line under it. Use it when you want structure without decoration.

On top of the preset you can choose a border colour, a background colour and a legend colour, set the padding and add an icon from a small built-in set. Use colour sparingly: one accent colour taken from your brand is usually enough, and it should keep good contrast against the background. You can set the defaults once for the whole site and only override the groups that need to stand out.

Step 4: lay out the fields inside the box

Short fields waste space when they are stacked. A first and last name, an email and a phone number, a city and a postcode all fit two to a row. Inside a group, you can choose one to four columns. With two columns, every field without a width of its own takes half the row. If one field needs the whole row, such as a street address, set it to the full width in the Gravity Forms layout editor and it stays full width.

This is deliberate: the layout editor remains the final say. The column setting is a convenient default for the whole box, and the widths you set by hand are never overridden. On a phone, every field takes the whole row anyway, because two narrow columns are hard to use with a thumb.

Step 5: show a whole group only when it is needed

Groups become powerful together with conditional logic. A typical case: the form asks whether the visitor wants a call back, and if the answer is yes, a group with the phone number and the best time appears. With the add-on you set the conditional logic once, on the Group Start, and the entire box appears and disappears.

There is a trap in this setup, and the add-on closes it. Imagine the phone number inside the hidden group is a required field. In plain Gravity Forms, a required field is only skipped when that field itself has logic that hides it. A field inside a hidden group has no logic of its own, so the form would complain about a field the visitor cannot even see. Visitors would get stuck on a form that cannot be submitted.

The add-on handles this on the server: when a group is hidden, every field inside is treated as hidden as well. Required fields inside a hidden group do not block the form, and values typed before the group was hidden are not saved. Because this happens on the server and not in the browser, it also holds when JavaScript is off. It works for nested groups as well, and a field with its own logic inside a visible group keeps following that logic.

Step 6: multi-page forms and AJAX

A group cannot cross a page break, because a page is a separate screen and a box cannot be in two screens at once. Put the Group End before the page break, or start a new group on the next page. The form editor warns you when a group would cross a page break, and on the site such a group simply shows no box, so that no field disappears by accident. Every page can have its own groups.

AJAX forms need nothing special. When a visitor submits and a required field inside a box is empty, the form comes back with the error message under that field and the box still around it.

Step 7: see the groups in entries and emails

A Gravity Forms entry with the Name field, then a grey heading row Filled details that comes from a group, then the Filled one field with its value tomatoes; a second group called Optional details has no heading because none of its fields were filled in
The entry shows the group legend as a heading, only for groups that hold a value.

Structure is not only for visitors. The people who read the entries benefit too. On the entry screen, the legend of a group is shown as a grey heading before its fields, exactly like a Section field. The all fields merge tag in notifications and confirmation messages does the same, in HTML and in plain text. If a group has no values, because it was hidden or the visitor skipped everything in it, its heading is left out, so emails stay short.

Accessibility checklist

  • Use a legend that makes sense on its own when read aloud: Delivery address, not Part 2.
  • Keep the description short; it is read together with the legend.
  • If a heading above the box already says it, hide the legend visually. It stays in the page for screen readers.
  • Check the contrast of the legend colour and the border against the background.
  • Do not nest more than you need. One level is available, and most forms do not need it.

Common mistakes

  • A box around everything. If the whole form is one group, the box adds nothing.
  • Groups without titles. The title is what makes a group useful, both visually and for screen readers.
  • A group that crosses a page break. Close it before the break.
  • Forgetting the Group End. The editor shows a warning, and the box is not shown on the site until it is closed.
  • Too many colours. One accent colour looks professional; five look like a sale banner.

Grouping fields is a small change with a big effect: visitors understand the form faster, finish it more often, and the entries you receive are easier to read. If your forms have grown long, start with the one that has the most visitors, group the questions into three or four boxes, and compare how many people complete it.

Frequently asked questions

Is the box collapsible?

No. The group box is always visible. For collapsible sections or tabs, use the GravityExtra accordion and tab panel add-on, which works on Section fields.

Does a group change what is saved in the entry?

No. Group Start and Group End store nothing. The fields inside save exactly as before, except that fields in a hidden group are not saved.

Can I nest groups?

Yes, one level deep: a group inside a group. A third level is ignored and the editor tells you.

What happens if my licence expires?

Groups already on your forms keep rendering. You only need an active licence to add new Group Start and Group End fields.

Which versions are supported?

Gravity Forms 2.9 or newer with WordPress 6.5 and PHP 7.4 or newer. The add-on is tested with Gravity Forms 2.9 and 3.1.

Give long forms some structure

Wrap related fields in a labelled group box with its own style, columns and conditional logic, without page breaks.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr