🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Checkbox Tree Setup Guide

Updated 9 min read Gravity Forms Fields & Inputs
On this page
  1. Video walkthrough
  2. What you need
  3. Install and activate
  4. Build a tree in the form editor
  5. Paste an indented list
  6. Import a CSV file
  7. Use a WordPress taxonomy
  8. Behaviour options
  9. What visitors see
  10. What is saved
  11. Merge tags
  12. Conditional logic
  13. Pre-population, multi-page forms and Save and Continue
  14. Keyboard and screen readers
  15. How it differs from the official Gravity Forms add-ons
  16. Uninstall

Video walkthrough

Gravity Forms Checkbox Tree Setup Guide: Nested Choices, Search & Parent Ticks
Video setup guide: Gravity Forms Checkbox Tree Watch on YouTube

The Gravity Forms Checkbox Tree add-on (Hierarchical Choices) adds a new field type, Checkbox Tree, that shows a whole nested list in one field. Visitors open the branches they need, search the list, and tick items with check boxes, or choose a single item in radio mode. Ticking a parent ticks all of its children, and a parent shows a mixed state when only some children are ticked. This guide covers installing the add-on, building a tree, the three tree sources, every behaviour option, what is saved, merge tags, conditional logic, accessibility and how the field differs from the official Gravity Forms add-ons.

What you need

You need Gravity Forms 2.9 or newer and WordPress 6.5 or newer on PHP 7.4 or newer. The field works with every form layout, with single-page and multi-page forms, with AJAX forms and with Save and Continue. The add-on makes no outside connection beyond checking gravityextra.com for your licence and plugin updates; the tree, the search and all checks run in the visitor’s browser and on your own server.

Install and activate

  • Upload the add-on zip in Plugins → Add New → Upload Plugin and activate it.
  • Go to Forms → Settings → Checkbox Tree, enter your GravityExtra licence key and press Activate License.
  • Open a form in the form editor. The new Checkbox Tree button is in the Advanced Fields group.

Without an active licence the field shows a short note in the form editor, visitors see a plain “not available” line instead of the tree, and the field never blocks a submission. Activate the licence again and every existing Checkbox Tree field comes back as it was.

Build a tree in the form editor

Add a Checkbox Tree field and open its settings. Under Choices come from pick where the items come from. The default, A list I build or paste, gives you the row builder: each row has a label, an optional stored value and six small buttons.

  • Left and right arrows outdent or indent the row, together with all of its children. A row can only be one level deeper than the row above it, so the tree always stays valid.
  • Up and down arrows move the row and its children above or below the neighbouring item on the same level.
  • Plus adds a new item after the row and its children; times removes the row and everything inside it.
  • Press Enter in a label to add the next item at the same level.

The preview in the editor refreshes as you work, so you see the tree the way visitors will. The field counts the items for you; a tree can hold up to 5,000 items and ten levels.

The form editor: the Checkbox Tree field preview next to its settings, with the CSV source, the row builder with indent, outdent, move, add and remove buttons, and the behaviour options
The field preview and its settings: source, row builder and behaviour.

Paste an indented list

Press Paste or edit as text to see the whole tree as text. Paste a list from a document or a spreadsheet and press Use this list. The add-on understands the usual ways people write nested lists:

  • Indent children with spaces (any consistent width) or with tabs.
  • Bullets such as a dash, a star or a round bullet at the start of a line are ignored.
  • A line such as Europe > France > Lyon adds the whole path at once; the parents are created or re-used.
  • Add a stored value after a bar: Lyon|lyon. Without a bar the label is also the value.

The text is read on your server and turned into the same simple form the builder uses: two spaces per level and label|value where the value differs. If two items end up with the same value, the add-on keeps them apart (a repeated label gets its full path as value, a repeated explicit value gets a number added) and tells you under the builder.

Import a CSV file

Choose A CSV file as the source, pick the file and press Import CSV. Commas, semicolons and tabs are detected automatically, and quoted cells may contain commas or line breaks. Three layouts are supported:

  • A path column with values like Design > Graphic design > Logos, and an optional value column.
  • label, value and parent columns, where the parent is the value (or the label) of another row and an empty parent means the top level. This is how most systems export categories.
  • One column per level, such as Region,Country,City. Empty cells at the start of a row repeat the row above, so spreadsheets that only write a parent once work too.

The CSV is read once into the list, so you can fine-tune it in the builder afterwards. The field remembers the file name so you know where the tree came from.

Use a WordPress taxonomy

Choose A WordPress taxonomy to build the tree from the parent and child terms of categories, tags or any public custom taxonomy, such as product categories or a “service area” taxonomy of your own. The terms are read every time the form is shown, so a term you add or rename appears without editing the form. Options:

  • Only these terms and their children: IDs or slugs, comma separated; each one becomes a top-level item.
  • Leave out these terms and their children, for example uncategorized.
  • Levels to show: 0 shows all levels.
  • Stored value: the term slug, ID or name.
  • Hide terms with no posts: parents with non-empty children stay.

Behaviour options

  • Visitors can choose: several items with check boxes, or one item with radio buttons (a radio tree).
  • Ticking a parent ticks all its children: on by default. The parent is ticked when every child is ticked and shows the mixed state when only some are. Turn it off to make every item independent.
  • Parents are only headings: parents have no check box and only open and close their branch.
  • Only items at the lowest level can be chosen: with the parent option on, ticking a parent still ticks its children but only the children are saved; with it off, parents cannot be chosen.
  • Save: the chosen items only, or the chosen items plus every fully ticked parent.
  • Minimum and Maximum: how many items may be chosen. A ticked parent counts as its children. The browser refuses a tick that would pass the maximum and says why; the server checks both limits again.
  • When the form opens: show only the top level, or open levels 1, 2, 3 or everything.
  • Show a search box and Show Select all and Clear.

What visitors see

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
Parents show the mixed state when only some of their children are ticked.

Each parent has a small arrow to open or close it and shows how many items are inside. Clicking an item ticks it; clicking a heading opens it. Below the tree a live line says how many items are chosen. The toolbar has the search box and the Expand all, Collapse all, Select all and Clear buttons.

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
Search keeps the matches and their parents, opens the branches and highlights the text.

Search ignores upper and lower case and accents. Items whose label contains the text stay visible with their parents, the branches open by themselves and the number of matches is announced. Clear the box, or press Escape, and the tree returns to how it was. When a search is active, Select all only ticks the items you can see.

What is saved

The server checks every submission against the tree, whatever the browser sent: only known values are accepted, radio mode allows one value, heading-only parents and leaf-only rules are applied, and the minimum and maximum are counted again. A ticked parent is turned into its children. The entry then stores each chosen item with its value and its full path, for example Europe > France > Lyon. Because the path is stored, an entry still reads correctly after you later rename or remove an item.

An entry in Gravity Forms: the Checkbox Tree answer shown as an indented list, Europe, France, Lyon and Asia, Japan, Tokyo and Osaka, with the stored values next to the chosen items
The entry shows the answer as an indented list with the stored values.
  • Entry screen and {all_fields}: an indented list; hover a chosen item to see its full path.
  • Entry list: the chosen item names, the first five and “+ N more”.
  • CSV export: the full paths, separated by “; “. Developers can change the separator with the gfcheckboxtree_export_separator filter.

Merge tags

  • {Label:5} — the full paths, separated by commas.
  • {Label:5:leaves} — only the chosen item names, such as “Lyon, Tokyo”.
  • {Label:5:values} — the stored values, handy for feeds and redirects.
  • {Label:5:count} — how many items were chosen.

Conditional logic

Other fields, notifications and confirmations can depend on a Checkbox Tree field. Choose the tree in the rule and use:

  • is / is not with a value, a full path or an item name — “is lyon” shows a field when Lyon is ticked.
  • contains, starts with, ends with with part of a value or path — “contains Asia > Japan” matches any Japanese city.
  • greater than / less than with a number — compares the count of chosen items, so “greater than 2” can show a travel budget question.

The rules work live in the browser and again on the server when the entry is saved and when notifications are sent.

Pre-population, multi-page forms and Save and Continue

Tick Allow field to be populated dynamically and give a parameter name, for example regions. Then ?regions=lyon,tokyo in the page address ticks those items when the form opens; a parent value ticks its children. On multi-page and AJAX forms the selection is kept when visitors go to the next page and back, and Save and Continue restores it from the resume link.

Keyboard and screen readers

The field follows the WAI-ARIA tree pattern: the list has the tree role, every item has its level, position and expanded and checked states, and partly ticked parents report the mixed state. Only one item is in the tab order at a time. Use the up and down arrows to move, right to open a branch or go to its first child, left to close it or go to the parent, Home and End for the first and last item, Space or Enter to tick, * to open all siblings, and type letters to jump to an item. Count changes and search results are announced.

How it differs from the official Gravity Forms add-ons

  • Chained Selects, the official Gravity Forms add-on, shows a chain of linked drop-downs loaded from a CSV: the visitor picks one value in the first drop-down, then one value in the next, and so on. It answers “pick one item at each level”.
  • Checkbox Tree shows the whole tree in one field and lets visitors tick many items in many branches at once, with parent and child selection, the mixed state, search and expand and collapse, from a list, a CSV or a WordPress taxonomy. In radio mode it can also pick a single item at any depth.
  • The core Checkbox field is a flat list; nesting it means several checkbox fields shown and hidden with conditional logic.

If you only need a flat list of choices filled from a taxonomy, posts or users, use our Dynamic Populate add-on (see its documentation). Checkbox Tree is the right tool when the parent and child structure matters.

Uninstall

Deleting the add-on removes its licence and settings options. Your forms and entries are kept; stored answers stay readable as text with their full paths.

Still need help?

Our support team answers tickets every day, usually within a few hours.

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