Conditional Logic on Post Categories
Conditional Fields are those fields that rely on users’ specific actions on some other input fields. If the determined fields are not triggered, then these conditional fields will not work. Now, you can add Conditional Logic to your Post Categories in Fluent Forms. Where the input fields of those categories will appear, that has a fixed category value.
This tutorial demonstrates how to set Conditional logic on Post categories.
The first step is to create a Post Form, by clicking on the Arrow icon in the Add a New Form button. Then select the Post Type as post for that form.
In the form editor, go to the Taxonomy Fields and select the Categories field. Then go to Post Fields & choose the Post Title and Post Content field. Next, suppose you select the Simple Text and Numeric Field from the General Fields. Click the Save Form button.
Go to the Settings & Integrations tab of the form and click on Post Creation. Here, click on Add Post Feed to create a new post feed. You will notice some options appear for configuring the feed.
Now here comes the important part. If you want the Text & Number fields to only appear when specific categories are selected. This can be done by using Conditional Logic. Go to the Input Customization option & select Yes on the Conditional Logic option. In order to match the condition of the category, you need to fetch the values of that particular category. To do so, preview the form and right-click on the Inspect Element. Then tap on the Category field to open the code that contains the category values.
The values entered in the conditional logic will then be added to the conditional logic. After that, don’t forget to save the form.
Now, in the Preview mode when you select the ‘a guest’ category. Only then the Text and Number field will appear, and not otherwise. Therefore, this is how you can apply the Conditional logic on Post Categories.