How to use the conditional field #248
Answered
by
simonswiss
NoelOConnell
asked this question in
Q&A
-
I'm looking to use the conditional field to show another field if a checkbox is checked. |
Beta Was this translation helpful? Give feedback.
Answered by
simonswiss
May 24, 2023
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
simonswiss
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! First of all, sorry for the very late response.
The way the conditional field works is as follows. It lets you setup a
discriminant
for a condition that can be either acheckbox
or aselect
field with a few options.You can then display an entirely different set of fields based on the condition, by providing a key for each condition (
true
/false
if you used acheckbox
, and each possible value if you used aselect
.Checkbox condition
Let's say you want to optionally display SEO title/description fields, but only if a user checks a checkbox.
Let's setup the following field in our schema: