Formidable Forms

The Most Advanced WordPress Forms Plugin and Form Builder

  • Features
  • Pricing
  • Blog
  • Support
  • Login
  • Get Formidable Forms

Conditional Logic

Last Updated: May 30, 2020

Knowledge Base → Forms → Form Building → Field Options → Conditional Logic
— Premium Feature —

Conditional logic can be used to hide and show form fields or sections of your form if any or all of several criteria are met. When a field is conditionally hidden, its value will be cleared.

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

Hide and show form fields

  1. Go into edit your form.
  2. Open the Field Options for the field that you want to conditionally hide or show.
  3. Select Use Conditional Logic and add any criteria that you want. For example, you may want to only show the current field if the 'Would you like to add your email address?' field is equal to 'Yes'.
    Conditionally show form fields
  4. Now, when the user meets the criteria in the conditional logic, the hidden field will appear.
    Conditional Single
    Please note that when a field is conditionally hidden, its value will be cleared.

Show a field when another is completed

  1. Go into edit your form.
  2. Open the Field Options for the field that you want to conditionally show.
  3. Select Use Conditional Logic and set it up to say:
    Show this field if any of the following match: Field X is NOT equal to ______(leave blank).
    Conditional Show if Not

Show a field if it includes a value

If you would like to display a field if another field contains a certain word/phrase, follow the instructions below.

  1. Go into edit your form.
  2. Open the Field Options for the field that you want to conditionally show or hide.
  3. Select Use Conditional Logic and set it up to "Show this field if any of the following match". For example, you may want to display an HTML field message when a certain email address is entered.
    Conditional Includes Logic
  4. Now, when the user meets the criteria in the conditional logic, the HTML field message will appear.
    Conditional Logic Includes Value
  5. To completely restrict email address in your form, enable the Submit button logic.

Conditionally display a section

To hide or show a section of your form, add a Section Heading field which uses conditional logic. All the fields inside the section will hide or show with the heading. Please note that when a section is hidden with conditional logic, all fields within the section will be cleared.

  1. Add a 'Section' → 'Heading' field. Drag and drop fields into the Section.
  2. Open the Section field's options click 'Use Conditional Logic' and add any criteria that you want.
    Conditional Logic
  3. If you do not want to see the heading for this section, open the Field Options and set the Label Position to 'None'.
  4. When the user meets the criteria in the conditional logic, all the fields inside of the Section Heading will appear.
    Conditional Section Heading 1

Display selected number of fields

If you would like to allow users to fill out an identical field n times, where n is dependent on the number selected in another field, follow the instructions below to set this up. This may come in handy if you have a field where a user selects the number of tickets and you want 3 text fields to show up if '3' is selected for the number of tickets.

  1. Add a dropdown field for selecting the number of sets to show. The options for this field would simply be numbers: 1, 2, 3, etc.
    Conditional Dropdown
  2. Add a 'Single Line Text' field and title it 'Name'.
  3. Use the duplicate icon in the upper-right of each of your new fields to create the exact same field. Continue duplicating each field until you have the maximum number of fields that you need. For example, if your user can select up to five from your dropdown created in Step 1, you need create five 'Name' fields.
  4. Add conditional logic to each of the 'Name' fields.
    1. Conditional logic settings for the first 'Name' field:
      Conditional Logic 1
      If you want your first 'Name' field to always be visible, do not use any conditional logic for this field.
    2. Conditional logic settings for the second 'Name' field:
      Conditional Logic 2
    3. Conditional logic settings for the third 'Name' field:
      Conditional Logic 3
    4. Add similar logic to the rest of the 'Name' fields in your form.

Now when the user selects the number of names to input, the selected number of fields will show.
conditional gif

Conditionally skip a page

Conditionally skip a page based on a response from the user.

  1. Add a Page Break field to your form and open its Field Options.
  2. Click Use Conditional Logic and add any criteria that you want.
    Conditional Logic Skip Page

Related Videos

  • How to Use Conditional Logic
  • Hide and show form fields
  • Show a field when another is completed
  • Show a field if it includes a value
  • Conditionally display a section
  • Display selected number of fields
  • Conditionally skip a page
  • Related Videos
Categories
×

Categories

  • Installation & Getting Started
  • Account Management
  • Forms
  • Entries
  • Views
  • Styles
  • Importing & Exporting
  • Add-Ons
  • Extend Formidable Forms
Install Formidable Lite

Using WordPress and want to get Formidable Forms for free?

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact

Top Features

  • Front End Editor
  • Repeating Fields
  • Views from Entries
  • Calculator Forms
  • Conditional Logic
  • Visual Form Styler
  • Form Templates
  • User Submitted Posts
  • File Upload Forms
  • Spam Protection
  • Multi Page Forms
  • Surveys & Polls
  • Form Graphs & Charts
  • Save and Continue
  • Mobile Forms
  • Stripe Forms
  • PayPal Forms
  • WooCommerce Forms
  • MailChimp Forms
  • User Registration
  • Signature Forms
  • Bootstrap Forms
  • Quiz Maker
  • Zapier Forms
  • Salesforce Forms
  • HubSpot Forms
  • API Webhooks
  • Multilingual Forms
  • Directories

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • Blog

Copyright © 2021 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews