Skip to content

Forms & Surveys · 2 min read

Use Conditional Logic on a Form

Conditional logic changes the form while someone fills it in, and again when they submit. Show/hide updates as they answer. A redirect, a custom message, or a disqualification runs on submit, and only the first matching submit rule is used.

Before you start

  • Open Sites > Forms and edit the form, or create one.
  • Add the fields and, if you sell something, the Sell Products element with its products and variants.
  • A rule can use AND or OR, not both in the same rule.

Add a rule

  1. Click Conditional Logic.
  2. Click Add New Condition.
  3. Choose Show/Hide Fields, Redirect to URL, Display Custom Message, or Disqualify Lead.
  4. Set the IF side: pick a field or a product, pick an operator, and enter the value.
  5. Set the THEN side: which fields, products, or page the action should use.
  6. Save the condition.
  7. Open Preview and try the answers that should and should not match.

Show or hide one product

  1. Add a condition and choose Show/Hide Fields.
  2. Set the IF side from an answer or a selected product.
  3. Choose the whole Sell Products element, one product, or one variant.
  4. Choose show or hide.
  5. Save and test it in Preview.
Later show/hide rules override earlier ones when both match. Submit actions do not: the first matching redirect, message, or disqualification wins.
Text fields can match equal, not equal, contains, starts with, ends with, empty, or filled. Numbers and money can also use greater than, less than, and between. Between includes both ends. Dates can be equal, before, after, or between. A checkbox for terms is checked or not checked. A file or signature is empty or filled.
On a calendar that uses a custom form, show/hide still controls fields. A disqualification stops the appointment and the payment. To use a redirect or a custom message on that booking, choose Use custom form rules in the calendar confirmation settings.

You should see

The preview shows or hides the fields and products as you answer. A matching submit rule sends the visitor to the URL, shows your message, or stops the lead. If a rule will not save, fill in the field, the operator, the value, and the action.

Did this answer your question?

No, I need help

More in Forms & Surveys