ChargeForms
Building Forms

Conditional Logic

Show, hide, or require fields based on a visitor's earlier answers.

How rules work

Conditional logic is built from rule groups. Each group has its own AND/OR logic across its rules, and groups are combined with OR between them — if any group matches, the condition is satisfied.

A rule compares one field's current value against an operator:

  • is / is not
  • contains / does not contain
  • is empty / is not empty

Setting it up

  1. Open a field's settings panel in the builder.
  2. Switch to the Conditional Logic tab.
  3. Choose the action — Show this field, or Hide it — when the rules below match.
  4. Add one or more rule groups, each referencing an earlier field's answer.

Why it's safe to rely on

Visibility rules run twice: once in the browser (via frontend.js, for instant feedback as a visitor types) and again on the server when the form is submitted. The server-side check is the one that actually matters — a hidden required field can't be forced through by disabling JavaScript or editing the page's HTML, because SubmissionHandler::handle() re-evaluates every rule against the submitted values before deciding what's required.

Multi-step forms

Conditional logic works across multi-step forms too — a rule can reference an answer from any earlier step, not just fields on the same page.