Skip to content

Conditional Logic Overview: Build Smarter Forms

Conditional logic makes a form react to what people choose or type. It helps you show the right fields, run the right actions, and keep the flow clean without writing code.

What conditional logic does

Some form fields only matter after you know a little more about the person filling them out. Conditional logic keeps those fields out of the way at first, then reveals the right fields, actions, or messages when an answer makes them relevant.

Conditional logic lets your form respond to what a user enters. Think of each rule as simple if this, then that logic: when the conditions pass, GriffinForms can show fields, change messages, or redirect the user, turning a static form into a more adaptive flow.

Conditional Logic workspace showing rules, conditions, actions, and live summaries
Visual workspace with rule summaries and connectors.

Live example

This is the kind of rule you can build in GriffinForms without writing code: if Customer type is Business, show the Business details row and keep the extra fields out of the way for everyone else.

Switching this value is like a GriffinForms rule that watches one field and shows a different row.

Personal details

Business details

In GriffinForms, the matching rule is straightforward: when Customer type equals Business, the Business details row becomes visible. When the choice changes back, the row hides again.

Why it helps

  • Shorter forms: ask only the questions that matter.
  • Higher completion: reduce confusion and form fatigue.
  • Cleaner data: show validations only when they are useful.
  • Dynamic UX: guide users with visibility changes, messages, and redirects.
Conditional logic benefits overview with shorter forms and cleaner data
Conditional logic keeps forms short and focused while improving completion.
  • Age gate: If Age is more than 18 → show Driving License Upload.
  • Employee flows: If Email ends with @company.com → show Employee ID.
  • Tiered success: If Membership = Gold → redirect to Gold thank-you page.
  • Multi-step forms: If Plan = Enterprise → show the next page and unlock premium fields.
  • Smart warnings: If Order Total > 5000 → show top-of-form warning to verify address.
  • Row logic: If Country is Canada → show the “Shipping Details” row and update its heading.

Conditional Logic is not a replacement for core validation or security. Avoid overly complex, circular rules, and keep each rule focused on one clear decision. GriffinForms guards against obvious loops, but simpler rules are easier to test and maintain.

Open the workspace

  1. Open your form and go to the Builder.
  2. Click the top-right icon in the title bar to open Conditional Logic.
  3. The workspace opens as an overlay with rule summaries and controls.
Conditional Logic workspace opened from the builder toolbar
Use the top-right icon in the title bar to open the Conditional Logic modal.

Rules, conditions, and actions

The Conditional Logic workspace is built around three parts: the rule, the conditions, and the actions. In the modal, the rule is the container you save, the conditions are the checks you set up inside it, and the actions are the changes GriffinForms makes when those checks pass.

  • Rule: the saved decision block in the Conditional Logic modal. It holds the conditions and actions that belong together.
  • Conditions: the comparison rows inside the rule editor. They decide whether the rule should pass.
  • Actions: the change rows in the same editor. They describe what GriffinForms should show, hide, enable, update, or redirect.
  • ALL group — every condition must be true (AND).
  • ANY group — at least one condition must be true (OR).
  • The rule passes when both groups evaluate to true (empty groups are treated as true), then the action rows run in order.

Conditions are the comparison rows you set inside a rule. Each one compares an item against a value using an evaluator, so you can decide whether the rule should continue.

What to compare

  • Item type: usually Field or User.
  • Item: the specific field (e.g., Age, Email).
  • Attribute: value, value count, password strength, address component, or payment attribute.

How to compare it

  • Text: equal to, not equal to, contains, starts/ends with
  • Numeric: less than, more than, equal to
  • Dates: before, after (use ISO YYYY-MM-DD)
  • Time: earlier than, later than
  • Presence: is empty, is not empty
  • Checks: is checked, is not checked, accepted, not accepted
  • Pattern: matches pattern (regex), not matches pattern

This is the part of the modal where you tell GriffinForms what to watch for. When the condition screen is complete, the rule summary will reflect the comparison you chose.

Actions are the changes that run after the rule passes. In the action screen, you choose what GriffinForms should do with the target item.

What to change

  • Item type: Field, Row, or Form
  • Item: specific field, row, or the whole form
  • Target attribute: visibility, state, value, label, heading, classes, option groups; or form success/redirect/notices

Common changes

  • Visibility: show, hide, show error/warning/info/popup
  • State: enable, disable
  • Value/Label: set/change to
  • Heading: change row heading, add/remove heading class
  • Classes: add class, remove class
  • Options: show/hide select option groups by label
  • Success: change or append success message/redirect
  • Submit: change label or state

If the conditions screen answers should this happen, the actions screen answers what should happen next. The saved rule summary combines both parts into one readable line.

Conditional Logic rule overview with condition groups and actions
Rules combine condition groups with actions that run in order.

Variable Builder and summaries

Use the Variable Builder to reference dynamic values inside conditions or actions without typing complex syntax.

  • Field value: inserts the current value of another field.
  • Value count / iterations: reference how many values/rows a field has.
  • Arithmetic: combine numbers (e.g., Adults + Children).
  • Date compare: compare one field’s date against another.
Variable Builder overlay for building dynamic tokens and comparisons
Build tokens and comparisons with the Variable Builder overlay.

Each rule shows a natural‑language summary that updates as you edit, so you always see what the rule does at a glance. This is one of GriffinForms' most helpful touches because you do not have to decode the setup to understand the result. The summary reads like a sentence, so it is easier to review, explain, and fix later.

What summaries show

  • What it affects: for example, the Email field or the whole form.
  • What it changes: show, hide, message, redirect, or state.
  • How the logic reads: a quick view of ALL and ANY groups.
  • Helpful status: warnings when a rule needs attention.

Working with summaries

  • Click a summary to jump to its rule for quick edits.
  • Use collapse/expand to focus on the rule you’re testing.
  • Prefer one intent per rule for clearer summaries.
  • Keep action labels specific: “Disable Submit” vs “Change state”.
Conditional Logic rule summaries with live labels, badges, and chips
Natural‑language summaries with badges and chips.

Best practices and common patterns

Conditional logic can change how a WordPress form behaves in real time. Use it to:

  • Show/hide fields or rows to keep your contact form short and focused.
  • Enable/disable fields when prerequisite answers are missing.
  • Update values or labels to personalize a form step or confirmation.
  • Swap success messages or redirects based on user choices.
  • Show inline messages (error, warning, info, popup) during completion.
  • Adjust submit button state or label for guided workflows.

Use conditions that match the field type you’re working with:

  • Text and numbers: equals, not equals, contains, starts with, ends with.
  • Dates and times: before/after, earlier/later.
  • Checkboxes: checked or not checked.
  • Terms: accepted or not accepted.
  • Address fields: country/state/postal comparisons and completion checks.
  • Payment fields: selected product/gateway, totals, and counts.
  • User browser time: before or after a time window.
  • Password strength: weak, medium, strong, very strong.
  • Use multiple actions per rule to keep related changes together.
  • Create several small rules instead of one giant rule — easier to read and debug.
  • Order matters: actions run top-to-bottom when a rule passes.
  • Prefer explicit states (e.g., hide in one rule, show in another) over toggles.

Start simple

Start simple: add one rule, preview your form, and iterate. GriffinForms gives you a lot of control through conditional logic, so you can shape the form step by step instead of forcing every visitor through the same path. Use that power to keep forms lighter, guide people more carefully, and make the experience feel personal without making it harder to manage.

Next steps

If you are trying to make a form adapt to answers, next see Condition types and Action types. If you want a step-by-step example of how to show or hide fields automatically, read Show or hide fields automatically. If you want the browser-side limits and alert types, read Limits and alerts. If you still cannot find what you need, check Builder warnings or post the details in WordPress.org support.