Guide · 6 min read
Conditional logic in forms, explained
Conditional logic lets a form react to what people type, so everyone sees only the questions that apply to them. This guide explains how to show and hide fields, branch between pages, and add calculations or scoring without making your form feel like a maze.
What conditional logic is
Conditional logic is a set of rules that change a form based on earlier answers. Instead of one rigid list of questions, the form adapts in real time: a field appears, a page is skipped, or a total updates the moment someone makes a choice.
The goal is to show the right questions to the right people. A new customer and a returning one do not need the same form, and conditional logic lets a single form serve both without asking anyone to wade through irrelevant fields.
Show and hide fields
The most common use of conditional logic is showing or hiding a field based on a previous answer. This keeps forms short, because respondents never see questions that do not apply to them.
A few practical examples:
- If someone selects Other, reveal a text field asking them to specify.
- If a respondent answers No to Do you have an account?, hide the account-number field.
- If the country is United States, show a state dropdown; otherwise hide it.
- If a rating is 3 stars or below, reveal a follow-up box asking what went wrong.
Branch between pages
On multi-page forms, conditional logic can do more than hide a field, it can route people down entirely different paths. Branching rules jump a respondent to a specific page (or straight to submit) when their answers match a condition, so a sales lead and a support request can follow separate flows in one form.
Branching is evaluated in order, and the first matching rule wins; if nothing matches, the form falls back to the next page in sequence. This makes long surveys feel short, because each person only walks through the pages meant for them.
Calculations and scoring
Calculated fields turn a form into a live calculator. They are read-only fields whose value is derived from a formula referencing other fields, so you can build order totals, price estimators, BMI calculators, or quiz scores that update as people answer.
In YeetForm, conditional logic and calculated fields are part of the free plan, so you can build a quiz that scores itself or a quote form that totals up add-ons without upgrading. Because YeetForm is AI-driven, you can also just describe what you want, for example, add a price calculator that sums the selected options, and the AI wires up the calculated field for you.