Conditional logic

Show or hide fields based on what a visitor has already answered.

Conditional logic lets a form change as it is filled in — asking for a company name only when someone selects “Business”, or revealing a follow-up question only when an answer needs one.

Adding a rule

  1. Click the field you want to show or hide.
  2. Open Conditional logic in its properties and enable it.
  3. Choose whether to Show or Hide the field when the rules match.
  4. Choose whether all rules must match or any one of them.
  5. Add rules. Each rule tests another field with an operator and a value.

Operators

Operator Matches when the other field
is Exactly equals your value
is not Does not equal your value
contains Contains your value anywhere (case-insensitive)
does not contain Does not contain your value
is empty Has been left blank
is not empty Has any value
greater than Is numerically larger
less than Is numerically smaller

greater than and less than compare numerically, so they suit Number fields. Using them on text produces a numeric comparison of whatever the text converts to, which is rarely what you want.

Show versus hide

The two actions are mirror images, and picking the right one keeps your rules readable.

  • Show when — the field is hidden by default and appears when rules match
  • Hide when — the field is visible by default and disappears when rules match

Prefer whichever needs fewer rules. “Show when Enquiry type is Business” is clearer than “Hide when Enquiry type is not Business”.

Worked example

A support form that asks for an order number only from existing customers:

  • Field: Order number
  • Action: Show
  • Logic: all
  • Rule: Are you an existing customer? is Yes

Mark the order number field required as well. Because rules are enforced server-side, it is only required when actually visible — visitors who answer “No” are not blocked by a field they never saw.

Why server-side enforcement matters

Many form plugins implement conditional logic purely in the browser. That creates a well-known failure: a hidden field marked required still blocks submission, and the visitor sees a validation error pointing at a field that is not on screen.

Sense Forms re-evaluates every rule on the server when the form arrives. Fields that should be hidden are skipped during validation and their values are discarded, so this problem cannot occur.