WPForms Blog

WordPress Tutorials, Tips, and Resources to Help Grow Your Business

How to Create Clutter-Free Forms with Smart Logic

by Courtney Robertson on Dec 22, 2016

Do you want to show or hide questions on your form based on the options the user selects? You can declutter your lengthy forms and increase your completion rate using a special feature called conditional logic. In this tutorial, we will show you how to create customized forms with smart logic.

How Smart Forms Help You Boost Growth

Creating smart forms by using conditional logic on your forms will greatly increase the number of form entries you receive, because it makes it easier for your website visitors to fill them out.

By displaying smart forms, you can:

  • Keep users focused on only the specific information you want
  • Tailor forms to each unique user’s needs
  • Make your form interactive
  • Add or remove form fields on the fly

Let’s take a look at some examples:

Ask For Comments

conditional smart logic service example

Show Just Enough Fields

conditional logic attendee example

Create a Customized Smart Logic Form

The first thing you need to do is install and activate the WPForms plugin. Here’s a step by step guide on how to install a WordPress plugin.

Also, you’ll need to have a form created. See our tutorial on how to create a simple contact form as an example to get started.

Now we’re ready to add some conditional logic.

Show Form Fields

Want to show a follow-up question when the user picks a specific answer? It’s easy.

Select the field you want to have appear and scroll down to Conditionals within the field options.  Select Enable conditional logic and Show.

Show conditional logic

Then in the options, select the primary question. Depending on the answer they give for the primary question, the follow-up question will display.

Hide Form Fields

You can also choose to hide a field based upon an earlier answer, just like in the previous example. Just select Hide instead of Show.

While you’re here, also take a look at the different options that will help you narrow down exactly when the follow-up question will display.

Conditional Smart Logic Form Hide Options

More than One Requirement

Let’s say that you want to display a field only if the user selects two specific options.

Select the AND button to add a second criteria. Your new field will only display if both of the prerequisites are met.

and logic

This OR That

When you want to display a new field if a user selects either of two answers, then you’ll want to use the OR option.

To make this work, select Add rule group.

OR Conditional Logic

Smart Notifications

The same smart logic used in the field options can also be used in your email notifications as well.

Go to Settings » Notifications.

settings » notifications

Then scroll down to Enable conditional logic.

enable conditional logic notifications

You can send an email notification based upon how a user answers the form questions. All of the methods listed above will also work for your notifications.

Now you’re all set! You’ve created a customized form with smart logic. When users fill out a form on your site, they will only see questions that are relevant to their needs.

You might also want to check out our guide that will save you time by having your form field choices automatically created and updated for you.

If you like this article, then please follow us on Facebook and Twitter for more free WordPress tutorials.

Comments

    1. Hi Gian! Unfortunately that’s not currently possible, but that feature is definitely on our radar & will be added in the future. You can subscribe to the weekly email newsletter (using the form in the sidebar) if you want to be notified as soon as new features are released.

      Here are the options that are currently available for showing/hiding a field with conditional logic:

      options for conditional logic

  1. Hi Keri,

    I’m trying to enable conditional logic but the select field is not populating? Any suggestions as to why it’s not.

    I’m asking if you have ever registered a course at this college, and using the checkbox the user picks yes or no. If they choose yes then conditional logic is to kick and have them enter their student number. I’m not getting any of the fields populating?

    Your help is greatly appreciated.

    Marvin

  2. Hi Keri,

    I figured out the issue. One other question, I found a code snippet I’d like to use to change the submit form – but where do I insert the code snippet?

    .wpforms-form button[type=submit] {
    background-color: #024488 !important;
    border-color: #024488 !important;
    color: #fff !important
    }

    .wpforms-form button[type=submit]:hover {
    background-color: #022B57 !important;
    }

    It doesn’t work in the CSS Classes in WPForm.

    Please help

  3. Hi,

    I have a problem. When I select a field to be “Required” but only shown upon certain conditions, I noticed that it will still be “Required” even it is not shown (i.e. even if the conditions are not met. It should only be “Required” if the conditions are met!

    Furthermore, I would like to change the language in the progress bar where it says “Step 1”. How can I change it to my language?

    1. Hey Karim,

      Currently, the field conditional logic applies to the fields visibility. It does not dynamically change the field’s “Required” setting on the fields.

      More complex conditional logic calculations, such as dynamically toggling a field’s required state, is something we plan on adding in Q2. It’s been a popular request and we look forward to providing that feature in the near future.

  4. Can the conditional logic determine the destination after the form is filled out? If they answer a question yes or no send them to a different pageafter the form is complete?

    1. Hi Angela, great question! Currently, conditional logic can be used for email notifications, but not for the confirmation settings. (The Confirmation settings menu is where you can choose to display a message or redirect users to a specific page or URL.) That sounds like an awesome feature, though! I’ll put in a feature request for you.

      If you’d like to be notified when new features are released, you can subscribe to our weekly newsletter using the form in the sidebar or at the bottom of this page 🙂

  5. Hi,

    I’m using conditional logic on my Wpforms, but when i try to send message, NOTHING ! Because some hidden (and required fields) for another option are not selected.

    For example, i have on my form, “Company” and “Blogger” option, and when you select “Blogger” you don’t see some required fields for “Company” so it’s impossible to send message because the form ask to fill all that fields before.

    How to fix this please ?

    1. Hi Thierry,

      Currently, the conditional logic works for field visibility, but it can’t dynamically change the field’s “Required” setting on the fields. So, users may not be able to submit your form if a required field might be hidden by conditional logic.

      We’re working on a feature to dynamically toggle a field’s required state, which we plan to release this year since it’s a popular request!

      If you’d like to be notified as soon as new features are rolled out, you can subscribe to the weekly newsletter using the signup form in the sidebar & footer of this page.

      Thanks for stopping by the blog, and feel free to get in touch with support if you have any other questions 🙂

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.