Smart forms adapt to each visitor. A business contact form should ask for a company name only when someone selects “Business.” A support form should route urgent tickets differently from general inquiries. A survey should reveal follow-up questions only when specific answers are chosen.

Auto Form Builder includes conditional logic with full AND and OR support — on individual fields and on form-level rules for emails and confirmations. Combine multiple conditions, choose how they interact, and build dynamic WordPress forms without code.

Last updated: Last update 20 August

Understanding AND vs OR Logic

When you add more than one condition to a rule, you choose how those conditions combine:

AND Logic — All Conditions Must Be Met

With AND logic (labeled “All conditions must be met (AND)” in field settings, or “all” in form rules), every condition must be true for the rule to trigger.

Example: Show the “Tax ID” field when Country equals USA AND Account Type equals Business. Both must be true — if only one matches, the field stays hidden.

OR Logic — Any Condition Can Be Met

With OR logic (labeled “Any condition can be met (OR)” in field settings, or “any” in form rules), only one condition needs to be true for the rule to trigger.

Example: Show the “Please specify” text field when Reason equals Other OR Reason equals Not listed. Either answer reveals the field.

Quick Comparison

Logic Type When It Triggers Best For
AND (all) Every condition must match Precise, narrow rules — “only when A and B and C”
OR (any) At least one condition must match Broader rules — “when A or B or C”

Where AND/OR Logic Applies in Auto Form Builder

Auto Form Builder uses AND/OR logic in two places:

1. Field-Level Conditional Logic

Control whether individual fields are shown or hidden based on other field values. Configure this in the field properties panel when editing a form.

  • Multiple conditions per field
  • AND or OR combination
  • Real-time show/hide as the visitor fills out the form

2. Form-Level Conditional Rules

Control what happens after submission based on the visitor’s answers. Configure these in the form’s Settings tab:

  • Conditional Confirmations — different success messages or redirect URLs
  • Conditional Notification Rules — skip, reroute, or customize admin notification emails
  • Conditional Confirmation Email Rules — skip or customize user confirmation emails

Each form-level rule has its own set of conditions combined with AND or OR. When multiple rules exist, they are checked from top to bottom — the first matching rule wins.

Available Condition Operators

Every condition compares a form field to a value using one of these operators:

  • Equals — field value exactly matches (case-insensitive)
  • Not equals — field value does not match
  • Contains — field value includes the specified text
  • Doesn’t contain — field value does not include the text
  • Greater than — numeric field value is above the threshold
  • Less than — numeric field value is below the threshold
  • Is empty — field has no value (no comparison value needed)
  • Is not empty — field has any value (no comparison value needed)

Comparisons are case-insensitive. Checkbox groups, multi-select dropdowns, and radio buttons are supported — selected values are evaluated correctly against your conditions.

Setting Up AND/OR Logic on Fields

Use field-level conditional logic to show or hide fields dynamically while the visitor fills out the form.

  1. Open your form in Auto Form Builder → Forms.
  2. Click the field you want to conditionally show or hide.
  3. In the properties panel, scroll to Conditional Logic.
  4. Check Enable Conditional Logic.
  5. Choose Logic Type:
    • All conditions must be met (AND)
    • Any condition can be met (OR)
  6. Click Add Condition for each rule you need.
  7. For each condition, set:
    • Show or Hide this field
    • The source field to watch
    • The operator (equals, contains, etc.)
    • The comparison value (unless using Is empty / Is not empty)
  8. Save the form.

Conditions within a field are separated visually by AND or OR labels, matching your chosen logic type.

Practical AND Logic Examples

Show a Company Field for Business Customers in the US

  • Logic Type: All conditions must be met (AND)
  • Condition 1: Account Type Equals Business
  • Condition 2: Country Equals United States
  • Action: Show “Company Name” field

Reveal Budget Field for High-Value Enterprise Leads

  • Logic Type: AND
  • Condition 1: Company Size Greater than 100
  • Condition 2: Plan Interest Equals Enterprise
  • Action: Show “Annual Budget” number field

Route Urgent Support Tickets to a Priority Inbox

In Form Settings → Conditional Notification Rules:

  • If all of these conditions match:
  • Department Equals Support
  • Priority Equals Urgent
  • Then: Send notification to [email protected]

Practical OR Logic Examples

Show “Other” Text Field for Multiple Selections

  • Logic Type: Any condition can be met (OR)
  • Condition 1: How did you hear about us? Equals Other
  • Condition 2: How did you hear about us? Equals Referral from friend
  • Action: Show “Please tell us more” textarea

Display Phone Field for Preferred Contact Methods

  • Logic Type: OR
  • Condition 1: Preferred Contact Equals Phone
  • Condition 2: Preferred Contact Equals SMS
  • Action: Show Phone Number field

Redirect Premium Users to a VIP Thank-You Page

In Form Settings → Conditional Confirmations:

  • If any of these conditions match:
  • Plan Equals Pro
  • Plan Equals Enterprise
  • Then: Redirect to https://example.com/vip-thank-you

Combining AND and OR Across Multiple Rules

You cannot mix AND and OR within a single condition group — each field or form rule uses one logic type for all its conditions. To combine both, use multiple rules evaluated in order.

Example: Route Emails by Department and Priority

Rule 1 (AND): If Department equals Sales AND Budget greater than 10000 → send to [email protected]

Rule 2 (OR): If Department equals Sales OR Department equals Partnerships → send to [email protected]

Default: If no rule matches → use the standard notification email.

Rules are checked from top to bottom. Rule 1 is evaluated first — if it matches, Rule 2 is never checked. Order your rules from most specific to most general.

How Conditional Logic Works on the Frontend

Field-level conditional logic runs in real time as visitors interact with your form:

  • Fields update instantly when a watched field changes — no page reload
  • Fields set to Show are pre-hidden on page load to prevent a flash of content before JavaScript evaluates conditions
  • Hidden fields have their inputs disabled, so they do not interfere with validation or submission
  • Required fields that are hidden by conditional logic do not block form submission
  • Dependent field chains (Field A controls Field B, which controls Field C) are handled automatically with multi-pass evaluation

Form-level rules (confirmations and emails) are evaluated on the server when the form is submitted, using the same operators and AND/OR logic.

Setting Up AND/OR Logic in Form Settings

For post-submission behavior — confirmations and emails — use the conditional rules editor in Form Settings.

  1. Open your form and click the Settings tab.
  2. Expand the section you need (Conditional Confirmations, Conditional Notification Rules, or Conditional Confirmation Email Rules).
  3. Click Add rule (or the equivalent button for that section).
  4. Set the logic selector to all (AND) or any (OR).
  5. Add one or more conditions with field, operator, and value.
  6. Configure the outcome — redirect URL, success message, email recipient, subject, or skip action.
  7. Add additional rules as needed, ordered from most specific to most general.
  8. Save the form.

Each rule can be expanded, duplicated, or removed independently. When multiple rules exist, a hint reminds you that rules are checked from top to bottom and the first match is used.

Tips for Building Effective Conditional Logic

  • Start simple. Begin with one or two conditions, test the form, then add complexity.
  • Use AND for precision. When every criterion must be true, choose AND.
  • Use OR for flexibility. When several different answers should trigger the same outcome, choose OR.
  • Order rules carefully. Put specific rules first and catch-all rules last in form settings.
  • Match values exactly. For dropdowns and radio buttons, use the option’s stored value — comparisons are case-insensitive but must match the option value.
  • Use “Is not empty” to show follow-up fields whenever any answer is provided.
  • Use “Greater than” / “Less than” with number fields for budget, age, quantity, or rating thresholds.
  • Test every path. Submit the form with different answer combinations to verify each condition group behaves as expected.

Get Started with Free Conditional Logic

AND/OR conditional logic for fields, confirmations, and emails is included in the free Auto Form Builder plugin — no add-on or subscription required.

Install from WordPress.org:

https://wordpress.org/plugins/auto-form-builder/

Last updated: Last update 20 August

Build forms that embed anywhere — free

Auto Form Builder lets you create multi-step forms, calculators, and lead capture forms in WordPress, then embed them on any site with a single line of code.

Install the free plugin

Frequently Asked Questions

What is the difference between AND and OR in form conditional logic?

AND requires every condition in a group to be true before the rule triggers. OR requires only one condition to be true. In Auto Form Builder, choose “All conditions must be met (AND)” or “Any condition can be met (OR)” in field settings, or “all” / “any” in form-level rules.

Can I add multiple conditions to one field?

Yes. Enable Conditional Logic on any field, add as many conditions as you need, and choose AND or OR to control how they combine.

What happens when multiple form-level rules exist?

Rules are evaluated from top to bottom. The first rule whose conditions match (using its AND or OR logic) is applied. If no rule matches, the form’s default settings are used.

Do hidden required fields block form submission?

No. Required fields hidden by conditional logic are disabled and excluded from validation, so they cannot prevent submission.

Which operators can I use in conditions?

Equals, Not equals, Contains, Doesn’t contain, Greater than, Less than, Is empty, and Is not empty. Comparisons are case-insensitive.

Can conditional logic control emails and redirects?

Yes. Form Settings supports conditional confirmations (success messages and redirects), conditional admin notification rules, and conditional user confirmation email rules — each with AND/OR condition groups.

Does conditional logic work with dropdowns and checkboxes?

Yes. Dropdowns, radio buttons, checkboxes, and multi-select fields are all supported. Selected values are evaluated correctly against your conditions.

Is conditional logic included in the free plugin?

Yes. Field-level AND/OR conditional logic and form-level conditional rules for confirmations and emails are included in the free Auto Form Builder plugin.


Leave a Reply

Your email address will not be published. Required fields are marked *