IM-BASE IM-BASE

Contact Us

How to Show or Hide Form Fields with Conditional Logic in IM Mail Form

How to Show or Hide Form Fields with Conditional Logic in IM Mail Form

Long contact forms can overwhelm visitors, especially when some questions are relevant only to certain users.

For example, a general inquiry form might ask for a product name, order number, or technical details—even when someone simply wants to ask a general question.

With the IM Mail Form Conditional Logic Add-on, you can show or hide fields based on what visitors select or enter.

This tutorial explains how conditional logic works and how to create a dynamic WordPress contact form without writing code.

1. What Is Conditional Logic?

Conditional logic allows a form to respond to user input.

Instead of displaying every field from the beginning, you can show additional questions only when specific conditions are met.

For example:

  • Show a Product Name field when a visitor selects Technical Support.
  • Show a text field when someone selects Other.
  • Hide questions that aren’t relevant to the visitor’s selection.

This keeps forms simpler while allowing you to collect detailed information when necessary.

2. Before You Begin

To follow this tutorial, you’ll need:

  • A WordPress website with IM Mail Form installed and activated.
  • The IM Mail Form Conditional Logic Add-on installed and activated.
  • A form that you want to customize.

Conditional Logic is an optional Add-on. It is not included in the free Core plugin.

If you haven’t installed the Add-on yet, you can learn more about it and access the free trial from the Conditional Logic product page.

3. Create an Example Contact Form

Let’s create a contact form that displays an additional field when someone requests technical support.

Step 1: Open the Form Editor

In your WordPress dashboard, open IM Mail Form.

Create a new form or edit an existing one.

Step 2: Add an Inquiry Type Field

Add a Select Box field and label it Inquiry Type.

Create the following options:

  • General Inquiry
  • Sales
  • Technical Support

This field will determine which additional questions visitors see.

Step 3: Add a Product Name Field

Add a Text field and label it Product Name.

This field should appear only when someone selects Technical Support.

At this point, your form contains both fields. Next, we’ll apply conditional logic to Product Name.

Creating the Inquiry Type and Product Name fields in IM Mail Form.

4. Configure Conditional Logic

Step 1: Select the Field You Want to Control

Open the settings for the Product Name field.

Conditional Logic is configured on the field that you want to show or hide.

Step 2: Enable Conditional Logic

Find and enable the Conditional Logic option in the field settings.

The conditional settings allow you to specify which field to monitor, which value to compare, and what should happen when the condition matches.

Step 3: Create the Condition

Configure the following rule:

Setting Value
Source Field Inquiry Type
Operator is
Value Technical Support
Action Show when condition matches

Configuring Conditional Logic to show the Product Name field when Technical Support is selected.

This rule means:

If Inquiry Type is Technical Support, show the Product Name field.

When visitors select General Inquiry or Sales, the Product Name field remains hidden.

Step 4: Save the Form

Save your changes.

Your form is now configured to show or hide the Product Name field based on the selected inquiry type.

5. Test the Conditional Form

Open the page where your form is displayed.

First, leave Inquiry Type unselected (Please select).

The Product Name field should remain hidden.

The Product Name field remains hidden when the condition is not met.

Next, select Technical Support.

The Product Name field should appear.

The Product Name field appears when Technical Support is selected.

Switch back to General Inquiry and confirm that the additional field disappears.

Before using the form on a live website, also test the final submission process, particularly when conditional fields are marked as required.

If your form includes a confirmation screen, check that the confirmation and submission flow works correctly for the different selections.

6. More Ways to Use Conditional Logic

Conditional Logic is useful for much more than technical support forms.

Show Additional Details for “Other”

Suppose your form includes a dropdown menu with several inquiry categories.

When visitors select Other, you can display a text field asking them to describe their request.

This keeps the form compact for visitors who choose one of the standard options.

Collect Product Information for Support Requests

For a technical support form, you might display questions about a product name, model, or software version only when the visitor selects a support-related option.

General inquiries won’t need to see those questions.

Customize Service Request Forms

A business offering several services can ask different follow-up questions depending on the service selected.

For example, a website development inquiry might need different information from a design consultation.

Simplify Forms with Optional Questions

Rather than showing every optional question immediately, display additional fields only when they become relevant.

This can make longer forms easier to navigate.

7. Conditional Logic vs. Recipient Routing

IM Mail Form also offers a Recipient Routing Add-on. Although both Add-ons can use form values as conditions, they solve different problems.

Conditional Logic controls what visitors see in the form.

For example, it can display a Product Name field when Technical Support is selected.

Recipient Routing controls where notification emails are sent.

For example, it can direct technical support inquiries to a support email address and sales inquiries to a sales team.

You can use these Add-ons together when you need both a dynamic form and conditional email routing.

8. Troubleshooting

The Field Doesn’t Appear

Check that Conditional Logic is enabled for the field you want to control.

Make sure the Source Field, Operator, and Value match your intended rule.

For example, if your dropdown option uses a different stored value from its displayed label, make sure the rule targets the correct value.

The Field Is Always Visible

Check the Action setting and confirm that the condition is configured to show the field only when the expected value matches.

Save the form again and test it in the front end.

The Form Doesn’t Submit as Expected

Test both the matching and non-matching conditions.

Pay particular attention to required fields, confirmation screens, and any existing validation settings.

If the problem persists, temporarily simplify the condition to isolate the configuration issue.

9. Try Conditional Logic Free for 30 Days

You can try the IM Mail Form Conditional Logic Add-on before purchasing a license.

The Add-on offers a 30-day free trial with access to its features.

It’s a practical way to explore dynamic forms and decide whether conditional fields are useful for your website.

Learn More About Conditional Logic

10. Summary

Conditional Logic helps you build contact forms that adapt to your visitors.

Instead of displaying every field to everyone, you can present additional questions only when they’re relevant.

With IM Mail Form Conditional Logic, you can:

  • Show or hide form fields based on user input.
  • Create flexible forms without writing code.
  • Ask different questions for different inquiry types.
  • Keep forms clear and focused.
  • Combine conditional fields with other IM Mail Form Add-ons.

Make your WordPress contact forms more flexible with IM Mail Form Conditional Logic.

Explore the Conditional Logic Add-on