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

How to Collect Nested Choices in Gravity Forms with a Checkbox Tree

GravityExtra
How to Collect Nested Choices in Gravity Forms with a Checkbox Tree

Some form questions have a shape. “Where can you volunteer?” is really two questions: which regions, and inside each region, which cities. “Which services do you need?” has a list of services, and each service has its own options. A job application asks for skills, and every skill has sub-skills. A membership form asks which departments and which teams. The answers are nested, and a flat list of check boxes does not show that.

This guide looks at the usual ways people handle nested choices in Gravity Forms, where each one starts to hurt, and how to collect them in a single, searchable, accessible field. The tool we use is the Gravity Forms Checkbox Tree add-on, but the design advice applies whatever you build.

Three common workarounds, and where they break

1. One very long checkbox list

The quickest option is to type every item into one Checkbox field: “Europe – France – Paris”, “Europe – France – Lyon”, and so on. It works for twenty items. With two hundred items the list becomes a wall of text. Visitors scroll, lose their place, and cannot say “all of France” without ticking every French city one by one. You lose the structure in the entry too: what you get back is a string of long labels, and reporting by region means splitting text in a spreadsheet.

2. A chain of fields with conditional logic

The next idea is to show the regions first, then reveal a country field for each ticked region, then a city field for each ticked country. For a small tree that is fine. For a real tree it means dozens of fields, each with its own conditional logic, and every change to the list means editing several fields and their rules. Entries are split across many columns, merge tags have to name every field, and a visitor who changes their mind half-way leaves hidden answers behind.

3. Linked drop-downs

Gravity Forms has an official add-on for nested data: Chained Selects. It loads a CSV and shows a chain of linked drop-downs. The visitor picks one value in the first drop-down, which fills the second, and so on. That is ideal when the answer is exactly one item at each level, such as a vehicle’s make, model and year. It does not fit questions where people choose several items, in several branches, or want to say “the whole branch”.

What a good nested-choice field needs

Looking at those workarounds, the requirements are clear:

  • One field for the whole tree, so the form stays short and the answer stays together.
  • Parents and children: ticking a parent should mean “everything inside”, and a parent should show when only part of its branch is chosen.
  • Expand and collapse, so visitors only see the branches they care about.
  • Search, because nobody wants to scroll through two hundred items to find “Osaka”.
  • Limits: a minimum and a maximum, and the option to allow only the lowest level, checked on the server where they cannot be bypassed.
  • Easy maintenance: paste a list, import a CSV or reuse the categories you already keep in WordPress.
  • Useful data: the chosen values with their full paths, ready for notifications, conditional logic and exports.
  • Accessibility: keyboard use and screen reader support from the start.

One field for the whole tree

The Checkbox Tree field shows the top level of your list first. A small arrow opens each branch and a badge shows how many items are inside. Ticking an item is a single click; ticking a parent ticks all of its children. When only some children are ticked, the parent shows a mixed state, the half-filled box people know from file managers and email clients. A live line below the tree counts the chosen items.

A Checkbox Tree on a form: Europe and France in the mixed state with Lyon ticked, Asia and Japan mixed with Tokyo ticked, and the count of chosen items below
Lyon and Tokyo are ticked, so their countries and regions show the mixed state.

Not every tree should work the same way, so the behaviour is set per field:

  • Check boxes or radio buttons. In radio mode the visitor chooses exactly one item, at any depth, which is a neat alternative to a long drop-down when the list is nested.
  • Parents as headings. Sometimes “Weekdays” and “Weekend” are just labels for the days inside them. Heading parents have no check box and only open and close.
  • Only the lowest level. When you need specific items, such as cities rather than countries, allow only leaf items. With the parent option on, ticking a country still ticks its cities, but only the cities are saved.
  • Minimum and maximum. “Pick up to four places” is enforced in the browser, with a message that says why a tick was refused, and again on the server.
  • How the tree opens. Show only the top level, or open the first one, two or three levels, or everything.

Search that opens the right branches

Long trees need search. Type a few letters in the search box and the tree keeps only the items whose names contain them, together with their parents. The branches open by themselves, the matching letters are highlighted and the number of matches is announced to screen readers. Upper and lower case and accents are ignored, so “lyo” finds “Lyon” and “evry” finds “Évry”. Clear the box and the tree returns to exactly how it was, with everything you ticked still ticked.

Searching the tree for ar: Paris, Marseille and Barcelona are shown with the matching letters highlighted, their branches open, France in the mixed state, and 3 matches announced
Searching keeps the matches and their parents and opens the branches.

Three ways to build the tree

The best tree is the one you can keep up to date. Checkbox Tree takes your list from wherever it already lives.

Build or paste a list

In the form editor, each item is a row with a label and an optional stored value. Arrow buttons indent and outdent a row together with its children, and move it up or down. Most lists already exist somewhere, though, so you can also paste them: indent with spaces or tabs, keep the bullets if you like, or write paths such as “Europe > France > Lyon”. Add a stored value after a bar, for example “Lyon|lyon”, when the value should differ from the label.

Import a CSV

If your list lives in a spreadsheet or another system, export it as a CSV. A path column, label / value / parent columns, or one column per level all work, and empty cells at the start of a row repeat the row above. The CSV is read once into the list, so you can adjust it in the editor afterwards.

Use your WordPress categories

If you already keep the structure in WordPress, as post categories, product categories or a custom taxonomy such as “service areas”, point the field at that taxonomy. Parent and child terms become the tree, read fresh every time the form is shown, so a new term appears in the form without touching it. You can start from chosen terms, leave terms out, limit the depth and hide empty terms.

Data you can use

A nested answer is only useful if it arrives in a usable shape. The add-on checks every submission on the server against the tree and the rules, turns a ticked parent into its children, and saves each chosen item with its value and its full path, such as “Europe > France > Lyon”. From there:

  • The entry screen shows the answer as an indented list, and the entry list shows the chosen item names.
  • Merge tags give you the full paths, just the item names, the stored values or the number of chosen items, for notifications, confirmations and feeds.
  • Conditional logic can test whether an item is chosen, whether any chosen path contains “Asia > Japan”, or whether more than two items were picked.
  • The CSV export writes the full paths, so a spreadsheet can be filtered by region without splitting labels.

The field also works with pre-population from the page address, multi-page forms, AJAX forms and Save and Continue, so a visitor who comes back later finds their tree exactly as they left it.

Built to be accessible

Nested lists are a classic accessibility trap: a pile of nested check boxes is tiring to tab through, and custom widgets often say nothing to a screen reader. Checkbox Tree follows the WAI-ARIA tree pattern. The list is announced as a tree; each item reports its level, its position and whether it is open, ticked, not ticked or mixed. Only one item is in the tab order, so one press of Tab moves past the whole field. The arrow keys move and open and close branches, Home and End jump to the first and last item, Space or Enter ticks, and typing letters jumps to a matching item. Changes in the number of chosen items, and search results, are announced.

Checkbox Tree, Chained Selects and the Checkbox field

Gravity Forms gives you good tools for related jobs, so it helps to know which one fits:

  • Chained Selects (official add-on): a chain of linked drop-downs from a CSV, one choice per level. Best when the answer is exactly one item at every level.
  • Checkbox field (core): a flat list. Best for short lists without structure; nesting it means extra fields and conditional logic.
  • Checkbox Tree: the whole tree in one field, many items in many branches, parent and child selection with the mixed state, search and expand and collapse, or a single choice at any depth in radio mode, with trees from a list, a CSV or a WordPress taxonomy.

And if what you need is a flat list filled from a taxonomy, posts or users, our Dynamic Populate add-on does exactly that. Use Checkbox Tree when the parent and child structure matters to the answer.

A short checklist for nested questions

  • Keep the top level short: five to ten groups is easier to scan than thirty.
  • Decide whether a parent means “everything inside” or is only a heading, and set the field to match.
  • Use the maximum when you have limited places or staff, and say so in the field description.
  • Give items stable values when the labels may change, so reports keep working.
  • Open the first level by default when most visitors need to look inside every group; keep everything closed when they usually need one branch.
  • Use the count merge tag in notifications so your team sees at a glance how broad an answer is.

Privacy and performance

The tree, the search and every check run in the visitor’s browser and on your own server. The add-on makes no outside HTTP request beyond checking gravityextra.com for your licence and plugin updates, and it loads its small script and style only on forms that contain a Checkbox Tree field. For every option in detail, read the Checkbox Tree documentation.

Wrapping up

Nested questions deserve a nested answer. Instead of a wall of check boxes or a maze of conditional fields, one tree lets visitors find, tick and review their choices in seconds, and gives you clean values with full paths for every notification, rule and report. Ready to turn your long lists into a tree? Get Gravity Forms Checkbox Tree.

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