Conditional Logic for Fields

This page explains how to use conditional logic to control fields in Elzo Forms.

Use conditional logic when a field should appear, hide, or behave differently based on another value or rule.

What conditional logic does

Conditional logic lets a form respond to the visitor’s input.

For example, you can show an extra field only when the visitor chooses a specific option.

This helps you keep forms shorter and more relevant. Visitors see the fields they need, instead of every possible field at once.

When to use conditional logic

Use conditional logic when:

  • a field is only needed for some visitors;
  • a form should show different follow-up fields based on a choice;
  • a longer form should stay cleaner;
  • a field should depend on another field value;
  • a section should appear only when it is relevant.

Avoid using conditional logic when a simpler form structure would be easier to understand.

Plan your rule first

Before creating a rule, write it in plain language.

For example:

  • Show Company name when Request type is Business.
  • Show Upload file when Do you want to attach a file? is Yes.
  • Hide Additional details unless Other is selected.

This helps you build the rule correctly in the builder.

Create a conditional rule

To create a field conditional rule:

  1. Open the form in the Elzo Forms builder.
  2. Select the field you want to control.
  3. Open the conditional logic settings for that field.
  4. Enable conditional logic.
  5. Choose the field or rule source.
  6. Choose the operator.
  7. Enter or select the value to compare against.
  8. Choose what should happen when the condition matches.
  9. Save the form.
  10. Test the form on the frontend.

The exact labels in the builder may vary by version, but the basic structure is the same: choose a source, choose an operator, choose a value, and choose the result.

Choose the condition source

The condition source is the value that the rule checks.

For standard field conditional logic, this is usually another field in the same form.

Choose a source that appears before the field you want to control whenever possible. This makes the form easier for visitors to understand.

Choose the operator

The operator tells Elzo Forms how to compare the source value.

Common operator patterns include:

  • is;
  • is not;
  • contains;
  • does not contain;
  • is empty;
  • is not empty.

Use the simplest operator that matches your rule.

For example, if the rule should match one exact option, use an exact match operator instead of a broader text match.

Choose the result

The result is what happens when the condition matches.

Depending on the available settings, a rule may show a field, hide a field, or control another part of the field behavior.

Use clear logic that you can test easily.

For example:

  • Show the message field when the visitor selects Other.
  • Hide the upload field unless the visitor selects Yes.

Test the rule

Always test conditional logic on the frontend.

To test a rule:

  1. Open the page where the form appears.
  2. Change the field that controls the condition.
  3. Confirm that the conditional field responds correctly.
  4. Try a value that should match.
  5. Try a value that should not match.
  6. Submit a test entry.
  7. Confirm that the saved submission contains the expected values.

Testing both matching and non-matching values helps catch mistakes.

Use conditional logic with required fields

Be careful when a required field is hidden by conditional logic.

If a required field is hidden but still required, the visitor may not be able to submit the form.

After adding conditional logic to a required field:

  1. Test the form when the field is visible.
  2. Test the form when the field is hidden.
  3. Confirm that submission works in both cases.

Keep conditional logic simple

Conditional logic is powerful, but too many rules can make a form harder to maintain.

Use these guidelines:

  • Start with one rule.
  • Test it before adding another rule.
  • Use clear field labels and option labels.
  • Avoid creating circular logic.
  • Avoid hiding important instructions.
  • Document complex form behavior for your own team.

Troubleshooting

The field does not show

Check that the source field, operator, and value match the actual visitor input. Also check spelling, capitalization, and option values.

The field always shows

The rule may be too broad, or the default state may not be configured as expected. Test the form with values that should not match.

The form does not submit

Check for hidden required fields. A hidden required field can block submission if the form still expects a value.

The saved submission is missing a value

If a field is hidden, the visitor may not submit a value for it. Review whether the field should be hidden or whether it should remain visible.

The rule works in preview but not on the live page

Clear the site cache and check for JavaScript errors, optimization plugins, or theme conflicts.

  • Advanced Conditional Logic in PRO
  • Field Settings
  • Multi-Step Forms
  • Troubleshooting Forms That Do Not Submit

Applies to

  • Elzo Forms Free
  • Elzo Forms PRO
  • WordPress admin
  • Frontend form display

Last reviewed

2026-07-04