Home › Forums › General Issues › Conditional logic in register field › Reply To: Conditional logic in register field
Hi Nicolas,
You can dynamically display fields in your template, based on the value selected in your “Profil” field.
Assuming you’re using a selection field with a single value selectable.
It mays work if you keep the “returned value” setting as “value” and you fill your “choices” setting with value only (not “value : label”).
So you could have something like:
if (get_field('your_selection_field_name') == 'Joueur') {
$condition = true;
}
//Display your selection field first
echo the_field('your_selection_field_name');
//Then, display your conditional fields based on your condition
if ($condition == true;) {
echo $conditional_field_1;
echo $conditional_field_2;
echo $conditional_field_3;
//Etc...
}
Let me know if it helps,
RemSEO
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.