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 namewhenRequest typeisBusiness. - Show
Upload filewhenDo you want to attach a file?isYes. - Hide
Additional detailsunlessOtheris selected.
This helps you build the rule correctly in the builder.
Create a conditional rule
To create a field conditional rule:
- Open the form in the Elzo Forms builder.
- Select the field you want to control.
- Open the conditional logic settings for that field.
- Enable conditional logic.
- Choose the field or rule source.
- Choose the operator.
- Enter or select the value to compare against.
- Choose what should happen when the condition matches.
- Save the form.
- 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:
- Open the page where the form appears.
- Change the field that controls the condition.
- Confirm that the conditional field responds correctly.
- Try a value that should match.
- Try a value that should not match.
- Submit a test entry.
- 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:
- Test the form when the field is visible.
- Test the form when the field is hidden.
- 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.
Related pages
- 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