Do you want to know how to enable conditional logic for user ratings on your WordPress forms? Being able to show and hide certain form fields based on your site visitors’ ratings is a great way to find out more about why people feel the way they do.
In this article, we’ll show you how to enable conditional logic for user ratings using WPForms.
What is Conditional Logic and Why Use It?
Conditional logic is a form builder feature in WPForms that lets you show or hide form fields based on user selections.
There are many reasons why you might want to use conditional logic on your WordPress forms:
- Streamline the Process. Make your forms less confusing and easier to fill out, while still gathering the information you need.
- Shorten Forms. When it comes to designing your forms, shorter is better. Using conditional logic to hide fields that don’t matter is a great way to fight form fatigue and boost form conversions.
- Customize the Experience. Use conditional logic on your WordPress forms to give each site visitor an engaging and more personalized experience.
In fact, one of the best kinds of WordPress forms you can place on your WordPress site that comes with smart conditional logic is a survey form.
Using the Surveys and Polls addon, you can turn the following form fields into smart form fields:
However today, we’re going to look at how to enable conditional logic for the user ratings form field on a survey form.
Create a Survey Form in WordPress
Next, you’ll need to install and activate the Surveys and Polls addon.
For help with finishing your survey form, check out our tutorial on how to create a survey form in WordPress.
Here’s what an example survey form looks like in the Form Editor:
And don’t forget, you’ll need to know how to add user ratings to your survey form too.
Note: You can add a user rating field to any WordPress form you create using WPForms. But for our example, we’re using the Survey Form template.
For more details, check out this documentation on how to customize the user rating form field.
Once you’ve customized the user rating field to your liking, you’re ready to enable conditional logic.
Enable Conditional Logic for User Ratings
Now that you have your survey form’s Rating field the way you want it, you’re ready to enable conditional logic to create a clutter-free form that still collects all the data you need from site visitors.
For our user ratings example, we’ll ask site visitors to explain a good rating, which we’ll set to be either a 4 or 5 star rating.
To start, we’ll add a Paragraph Text form field to our survey form so that if a site visitor gives a rating of 4 or 5 star rating, the text box will appear for them to fill out.
First, click on the Add Fields section in the Form Editor, and then drag the Paragraph Text form field from the left hand panel to the right hand panel.
Place it directly under the Rating form field.
Click on the newly added form field to make the following changes to meet your needs:
- Change the form field label
- Add a description
- Make it a required field
- Change the field size
Next, click on the section labeled Conditionals and then on the checkbox labeled Enable conditional logic.
After you click on this, you’ll be able to define the conditional logic rules.
For the first rule, we’ll set the conditional logic to read Show this field if Rating is 4.
Next, click the Add new group button so you can add the second conditional logic rule.
Set the second conditional logic rule to read Show this field if Rating is 5.
Click Save when you’re done.
Now, the only time the paragraph text field will appear on your survey form is if a site visitor selects a 4 or 5 star rating.
And there you have it! You now know how to enable conditional logic for user ratings on your survey form.
If you are interested in boosting your email marketing efforts using smart conditional logic, and happen to use one of the most popular email marketing services, MailChimp, check out this helpful guide on how to let users select MailChimp groups on your WordPress forms.
So, what are you waiting for? Get started with the most powerful WordPress forms plugin today.