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

Gravity Forms Conditional Choices Setup Guide

Updated 11 min read Gravity Forms Fields & Inputs
On this page
  1. What you need
  2. Install and activate
  3. How it differs from other tools
  4. Where the rules live
  5. The four actions
  6. Conditions
  7. Answers
  8. Dates
  9. Visitor
  10. Live in the browser
  11. Checked again on the server
  12. Products, options and totals
  13. When no option is left
  14. The overview page
  15. Export, import and copying rules
  16. Permissions
  17. Examples
  18. A cake shop
  19. A workshop booking over two pages
  20. Sessions that close on a date
  21. Good to know
  22. Questions

The Gravity Forms Conditional Choices add-on adds conditional logic to single choices. Gravity Forms can already show or hide a whole field; this add-on lets you show, hide, grey out or pre-select individual options of a field, based on other answers, a date or who the visitor is. The rules work live while people fill in the form, on single-page, multi-page and AJAX forms, and the server checks every submitted choice again, so an option that was not offered can never be submitted or charged. This guide covers installing the add-on, writing rules, how they behave in the browser and on the server, prices and totals, the fallback when no option is left, export and import, permissions and a few complete examples.

What you need

You need Gravity Forms 2.9 or newer and WordPress 6.5 or newer on PHP 7.4 or newer. The add-on adds no database tables and no scheduled tasks of its own: the rules are stored inside each form, next to the fields they belong to. It works with single-page, multi-page and AJAX-enabled forms, and with any payment add-on that charges the Gravity Forms order total.

Choice rules can be placed on these fields:

  • Radio Buttons, Checkboxes, Drop Down and Multi Select.
  • Product fields shown as radio buttons or a drop-down.
  • Option fields shown as radio buttons, a drop-down or checkboxes.

The “Other” choice of a radio field and the placeholder of a drop-down are never touched by a rule.

Install and activate

  • Upload the add-on zip in Plugins → Add New → Upload Plugin and activate it.
  • Go to Forms → Settings → Conditional Choices, enter your GravityExtra licence key and press Activate License.
  • Open any form and go to Settings → Conditional Choices to write its rules.

Without an active licence, saved rules stay in the form but are not applied: the form shows every choice and the server does not check them. The rules tab and the overview page show a short note with a link to the licence settings. When the licence is active again, the saved rules apply straight away.

How it differs from other tools

Gravity Forms’ own conditional logic works on whole fields, pages, buttons, notifications and feeds. It cannot hide one option of a field and leave the others. The usual workaround is to build several copies of the same field, one per situation, which makes entries, exports and notifications harder to read. Conditional Choices keeps one field and puts the logic on its options.

It also does a different job from several of our other add-ons, and works well next to them:

  • Our Dynamic Populate add-on fills a field’s choices from a data source, such as posts, users, entries or a table. Conditional Choices works on the choices you typed into the field yourself and decides, per choice, when each one is offered.
  • Our Content Personalization add-on swaps labels, choices or content by visitor signals such as country, campaign or device when the page is built. Conditional Choices reacts to the answers given in the same form, live, while the visitor fills it in.
  • Our Choice Limits and Inventory Limits add-ons hide or close a choice when it has been picked a certain number of times or is out of stock. Conditional Choices does not count anything: it decides from answers, dates and the visitor’s role.
  • Our Choice Cards add-on changes how choices look. Conditional Choices changes which choices are available; the two can be used on the same field.
  • The official Chained Selects add-on builds dependent drop-downs from an imported list, inside its own field type. Conditional Choices works on ordinary radio, checkbox, drop-down, multi-select, product and option fields, with conditions on any answer, a date or the visitor.

Where the rules live

Open a form and choose Settings → Conditional Choices. At the top, a table lists the form’s rules in plain words, for example “Disable when Date needed is before today+3 (reason: Needs 3 days’ notice)”. Below it, every field with choices is shown as a card with its options. Next to an option without a rule you see “Always available” and an Add rule link.

The Conditional Choices tab of a form: a summary table of the form's rules in plain words, then each choice field with its options and the rule builder for an option: action, all or any, and conditions on answers, dates or the visitor
The form's Settings, Conditional Choices tab: the rules in plain words at the top, then every choice field with a rule builder next to each option.

Each option can have one rule. A rule has three parts:

  • An action: show only when, hide when, disable when or pre-select when.
  • All or any: whether every condition must be met, or just one of them.
  • Conditions: one or more checks on an answer, a date or the visitor.

Press Save rules when you are done. The rules are checked once more on the server as they are saved: a condition that points to a field that no longer exists, an unknown operator or an empty date is dropped, and an option can never depend on its own field.

The four actions

  • Show only when: the option is hidden until the conditions are met. Use it for options that only make sense in one situation, such as a market stall that is only open on Saturdays.
  • Hide when: the option is offered unless the conditions are met. Use it for exceptions, such as fresh flowers that cannot be delivered.
  • Disable when: the option stays visible but is greyed out and cannot be chosen, with a short reason next to it (“Needs 3 days’ notice”, “Fully booked on Fridays”). People see that the option exists and why they cannot take it now.
  • Pre-select when: the option is selected for the visitor when the conditions become true, for example a gift box that is suggested with a celebration cake. The visitor can still change it. If the conditions stop being true and the visitor did not touch the option, it is unselected again.

Hidden and disabled options are both “not available”: they cannot be submitted and never count towards a price.

Conditions

Answers

An answer condition looks at another field of the same form: text, number, e-mail, drop-down, radio, checkbox, multi-select, product, option, hidden and similar single-value fields. The operators are the same as in Gravity Forms conditional logic: is, is not, greater than, less than, contains, starts with and ends with. Comparisons ignore upper and lower case. For a checkbox or multi-select field, is means “one of the ticked options is”, and is not means “none of the ticked options is”. For fields with choices, the builder offers the field’s choice values in a list, so you do not have to type them.

A field that is hidden by Gravity Forms’ own conditional logic counts as empty, just as it does in Gravity Forms.

Dates

A date condition looks at today (in your site’s time zone, from Settings → General) or at the answer of a Date field that uses the date picker. The operators are is before, is after, is on, is between (both days included) and falls on one or more days of the week. Dates are written as YYYY-MM-DD, or relative to today: today, today+3 or today-1. So “Date needed is before today+3” means “the visitor wants it sooner than three days from now”.

Visitor

A visitor condition checks whether the person is logged in, logged out or has a WordPress role, such as a trade customer, member or staff role. Use is not for the opposite. The role is checked again on the server when the form is submitted.

Live in the browser

When a form with rules is shown, the add-on’s script checks the rules straight away and again every time an answer changes. Gravity Forms’ own conditional logic runs as usual, and the rules are checked again after each of its passes, so options follow fields that appear and disappear.

A cake order form for local delivery on a Saturday: the Celebration tier cake is greyed out with the note Needs 3 days' notice, Fresh flowers is not offered, and the Evening delivery slot is greyed out with the note No evening deliveries at weekends
A cake order on a Saturday, two days from now, for local delivery: the tier cake is greyed out with its reason, fresh flowers are not offered for delivery and the evening slot is closed at weekends.
  • A hidden option disappears from the list or the drop-down.
  • A disabled option is greyed out and cannot be picked; the reason is shown under it (for a drop-down, after the option’s label) and as a tooltip.
  • If an option the visitor had chosen stops being available, it is cleared. For a drop-down, the placeholder or the first available option is selected instead. Gravity Forms then recalculates the total, calculations and its own conditional logic.
  • When every option of a field is ruled out, the fallback message appears below the field.

On a multi-page form, answers from earlier pages drive options on later pages, with or without AJAX. On an AJAX form, the rules are applied again on every page and after a validation error.

Page 2 of a two-page workshop booking form: the Sourdough masterclass option is greyed out for a beginner with the note For bakers with some experience, Knife skills is not offered, and the Recipe booklet extra is pre-selected
Page 2 of a multi-page form reacts to page 1: a beginner sees the masterclass greyed out with its reason and the recipe booklet already selected.

Checked again on the server

A browser can be changed by anyone who knows how to use its developer tools, so the add-on never relies on it alone. When the form is submitted, the server reads the submitted answers, applies exactly the same rules and checks every submitted choice. If one of them was hidden or disabled for those answers, the field shows a validation message, for example “Fresh flowers” is not available for your answers. Please choose another option. For a disabled option, the message includes your reason. No entry is created and no payment is taken.

The browser script and the server code are tested against the same set of cases, so what people see and what the server accepts always agree.

Products, options and totals

Rules work on product fields (radio or drop-down) and option fields (radio, drop-down or checkboxes). When an option is hidden or disabled, it is cleared in the browser and Gravity Forms recalculates the Total field at once. On the server, hidden or disabled product and option choices are kept out of the order lines, so the order summary, the Total field, the entry’s order total and the amount Gravity Forms passes to your payment add-on cannot include them. With Gravity Forms 3’s “validate total” setting, the posted total is compared with this same server total.

When no option is left

Sometimes the rules leave a field with no option at all, for example when both pick-up points are closed on a public holiday. In the form’s When no choice is left section you can set the message shown in place of the options. By default it reads “No option is available for your answers.”

If the field is required, the visitor would be stuck. Tick Relax “required” to let a required field stay empty when all of its options are hidden or disabled. The server applies the same check: the field may be empty only when no option is available for the submitted answers.

The overview page

Forms → Conditional Choices lists every form that has choice rules, with the number of rules, an Edit rules button and a table of field, choice and the rule in plain words. It is a quick way to review what visitors will see across the site.

The Conditional Choices overview under Forms: each form with rules, its rule count, an Edit rules button and a table of field, choice and the rule in plain words
Forms, Conditional Choices: every form with choice rules and each rule in plain words, with a link to edit them.

Export, import and copying rules

The rules are part of the form, so Forms → Import/Export keeps them: export a form, import it on another site, and its rules come along. On the rules tab, the Copy or paste rules as JSON box shows the form’s rules as text. Paste rules from another form into the second box and press Save rules to replace the rules of this form. Field ids and choice values must match; rules for fields or choices that do not exist are left out.

Rules are linked to the value of each choice. If you later change a choice’s value in the form editor, add the rule again for the new value.

Permissions

The rules tab and the overview page need the Gravity Forms edit forms capability. Administrators have it; you can give it to other staff with a role editor. The licence settings need edit settings.

Examples

A cake shop

  • “Celebration tier cake”: disable when Date needed is before today+3, reason “Needs 3 days’ notice”.
  • “Fresh flowers” (an option field): hide when Collection or delivery is “Local delivery”.
  • “Gift box”: pre-select when Cake is “Celebration tier cake”.
  • “Evening” delivery slot: disable when Date needed falls on Saturday or Sunday, reason “No evening deliveries at weekends”.
  • “Saturday market stall” pick-up point: show only when Date needed falls on Saturday.
  • “Wholesale tray”: show only when the visitor’s role is Trade customer.

A workshop booking over two pages

  • Page 1 asks for experience and what people will bring.
  • On page 2, “Sourdough masterclass” is disabled when experience is Beginner, with the reason “For bakers with some experience”.
  • “Knife skills” is shown only when “I will bring” includes “My own knives”.
  • “Sourdough starter” is shown only when the workshop is the masterclass, and “Recipe booklet” is pre-selected when experience is Beginner.

Sessions that close on a date

For an event with several sessions, give each session a rule disable when today is after its closing date, with the reason “Registration closed”. Visitors still see the full programme, but only open sessions can be chosen.

Good to know

  • One rule per option. Use any or all and several conditions to cover more cases in one rule.
  • Date conditions on a field need a Date field with the date picker. Date fields shown as drop-downs or separate inputs can be used in answer conditions, not date conditions.
  • Gravity Forms’ Repeater field (a developer-only field without an editor) is not supported.
  • Fields with several inputs, such as Name, Address or Time, are not used as condition sources.
  • If your site caches pages for logged-in visitors, role rules in the browser follow the cached page; the server check always uses the real visitor.
  • Changing a rule only affects new submissions. Existing entries are never changed.

Questions

Can a visitor still submit a hidden option by editing the page? No. The server checks every submitted choice with the submitted answers and refuses it with a validation message. No entry is created and nothing is charged.

Does a hidden product option change the price? No. It is cleared in the browser, the total recalculates, and the server leaves it out of the order total.

Do the rules work with AJAX and multi-page forms? Yes, on every page and after validation errors, with answers from earlier pages included.

What happens to the rules when I uninstall? Uninstalling through Forms → Settings → Uninstall, or deleting the plugin, removes the add-on’s settings and the rules stored in your forms. Forms and entries are kept.

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