Field visibility rules allow you to display or hide some fields on the entry page, based on the value entered in specific fields of the entry.
While creating content types, you can define rules for certain fields. These rules are like conditions, which, when met by the user while creating an entry, causes the specified fields to appear or disappear.
Field visibility rules lets you gather accurate data as it makes your entry form dynamic and displays only relevant fields. Owing to its high usability, many online forms sites and shopping sites already use this feature.
Here are some examples:
- While checking out from an online shopping site, if you select the Same as Shipping Address field, it hides the Billing Address field automatically. When you select Gender as Male, it automatically adds Mr before the First Name field and hides the Ms/Mrs title.
- While filling up a job form, if you select the Have any prior experience? field, it shows the Years of experience field, else it doesn’t.
You need to create an entry to see the rule in action.
Now that you know what Field visibility rules are, let’s look at how to use this feature in Contentstack.