WP Simple Pay Documentation

Documentation, Reference Materials, and Tutorials for WP Simple Pay

How to Use Conditional Logic for Form Fields

Reading time: 5 minutes | Difficulty: Intermediate

Overview

Conditional logic lets you show or hide a field on your payment form based on what the customer has already entered or selected on other fields. Use it to keep forms short by hiding irrelevant questions, reveal upsells when certain plans are chosen, or branch a single form into multiple flows — all without writing any code.

When a field is hidden by a rule, WP Simple Pay also removes it from validation and submission, so a required-but-hidden field will never block checkout.

Prerequisites

  • WP Simple Pay Pro (any tier)
  • A payment form with at least two fields — one whose value will drive the rule (the “source”), and one you want to show or hide (the “target”)

Step 1: Open the Conditional Logic Panel

  1. Navigate to WP Simple Pay > Payment Forms and edit the form you want to customize.
  2. Click the Form Fields tab.
  3. Expand the field you want to show or hide.
  4. Scroll to the Conditional Logic section at the bottom of the field’s settings.
Conditional Logic panel inside a form field's settings

The Conditional Logic panel is hidden for fields that don’t make sense as conditional targets — such as the payment method picker, the submit button, and the payment request button.

Step 2: Enable and Choose an Action

  1. Check Enable Conditional Logic.
  2. Set Action to either:
    • Show this field — the field is hidden by default and appears only when the rules match.
    • Hide this field — the field is visible by default and disappears when the rules match.
  3. Set Logic to control how multiple rules combine:
    • All rules match (AND) — every rule must be true.
    • Any rule matches (OR) — the action fires when at least one rule is true.
Conditional Logic action and logic selectors

Step 3: Build Your Rules

A rule has three parts: a source field, an operator, and a value to compare against.

  1. Click Add Rule to add a new rule row.
  2. Pick the source field from the dropdown — only eligible fields on this form appear in the list.
  3. Pick an operator. The available operators change based on the source field type (see the Available Operators section below).
  4. Enter the value to compare against. For checkboxes and certain operators like Is empty, the value field is ignored.
  5. Repeat for additional rules as needed.
Conditional Logic rule builder showing a configured rule and the Add Rule button

Save the form by clicking Publish or Update.

Available Operators

Operators are filtered to match the source field type, so you only ever see comparisons that make sense.

Source field Available operators
Text, Name, Email, Phone, Tax ID, Date, Coupon Equals, Does not equal, Contains, Is empty, Is not empty
Dropdown Equals, Does not equal, Is empty, Is not empty
Radio Equals, Does not equal
Checkbox, Fee Recovery toggle, Recurring Amount toggle Is checked, Is not checked
Number, Custom Amount Equals, Does not equal, Greater than, Less than, Is empty
Price/Plan Selector Price equals (compares against the selected price option)

Supported Field Types

Conditional logic rules can reference these source field types on the same form:

  • Text, Number, Dropdown, Radio, Checkbox
  • Customer Name, Email, Phone, Tax ID, Date
  • Price/Plan selector
  • Coupon, Custom Amount
  • Fee Recovery toggle, Recurring Amount toggle

Almost every field on the form can be a target (the field you show or hide), with the exception of structural fields like the payment method picker, the submit button, the payment request button, and a small number of other non-targetable elements.

Frequently Asked Questions

What happens to a required field when it’s hidden?

WP Simple Pay removes hidden fields from both validation and submission. A required field that is currently hidden by a rule will not block the customer from completing checkout — and its value will not be submitted with the payment.

How quickly do fields show or hide?

Rules are evaluated live as the customer types or changes a selection. Email-based rules begin evaluating once the customer’s entry is a valid email address.

Can I reference a field from a different form?

No. Rules can only reference fields that exist on the same payment form.

What if I delete or replace the source field of a rule?

Open the field that owns the rule and either pick a new source field from the dropdown or remove the rule entirely. Conditional logic settings for non-targetable fields are also cleaned up automatically when the form is saved, so orphaned rules don’t accumulate.

Does conditional logic work with Stripe Checkout (off-site) forms?

Conditional logic applies to on-site payment forms (embedded and overlay). Stripe Checkout forms render on Stripe’s hosted page and don’t support per-field conditional logic.

What’s Next?

Still have questions? We're here to help!

Last Modified:

Start Accepting Payments Today

Start accepting one-time and recurring payments or donations on your WordPress website.