Conditional logic
Conditional logic allows you to create interactive and responsive forms that adapt to respondents' answers, guiding them to relevant sections based on their responses.
Conditional logic is available for free to all Kiteform users.
Examples of Conditional Logic
Conditional logic is a versatile feature that customizes the form experience based on user inputs. Here are a few examples:
- Redirecting respondents to different survey sections based on their initial answers.
- Displaying additional questions if a respondent selects a particular option.
- Showing specific follow-up questions only if a respondent provides a certain type of feedback.
How to Implement Conditional Logic
To add conditional logic to your form, type /logic
.
Actions Available with Conditional Logic
After adding a conditional logic block, you can choose from six types of actions in the "Then" dropdown menu.
Jump to Page
This action allows you to skip irrelevant pages or redirect respondents to a different page. For example, you can configure it to send respondents under 18 to a specific page.
Place the conditional logic block on the page where you want the jump action to trigger. It activates when respondents click the “Next” or “Submit” button.
Rename Pages
Renaming pages helps you identify them easily, especially in lengthy forms. Click on the page number to rename it.
Calculate a Value
Use calculated fields to determine scores, prices, or other values based on respondents' answers. Note that calculations on date blocks are not yet available.
Make Answers Required
You can set a form field as required based on the respondent's input. For instance, make the email input field mandatory if the respondent signs up for your newsletter. Use the shortcut ctrl/cmd + shift + R
to make selected questions required.
Show or Hide Blocks
Display or hide questions or answer options based on user responses. For example, show an additional field only if the respondent selects 'Other'.
First, create the hidden block, such as a short answer block (/short
). Click ⋮⋮
to open the block settings and click Hide. Use the shortcut ctrl/cmd + shift + H
to hide selected blocks.
To hide multiple blocks at once, drag to select them and open the block settings to hide all selected blocks. Finally, insert conditional logic and choose the action Show or Hide blocks.
Hide Button to Disable Completion
Prevent respondents from submitting the form by hiding the submit button using the Hide button to disable completion action.
Redirect to Different URLs and Kiteform Forms
Redirect respondents to different websites, landing pages, or Kiteform forms upon completion. Use conditional logic and calculated fields to create an interactive landing page experience. For more details, read our redirect on completion guide.
Troubleshooting
Handling long forms with extensive conditional logic can be complex. Here are some steps to troubleshoot issues:
- Review Logic Blocks: Carefully check the conditional logic rules to ensure they link to the correct fields and actions.
- Edit Field Names: Use descriptive titles for fields to make managing and troubleshooting easier.
- Test Your Form: Run through different scenarios to identify errors by selecting various answer options.
- Use @ Mentions: Track values of inputs and calculated fields by placing @ mentions strategically.
- Simplify Logic: Reduce complexity to isolate specific conditions or actions causing issues.
By following these steps, you can effectively debug and enhance your form's logic.