Tell us what you are trying to do?
I am trying to achieve a conditional group on a user form with checkboxes. I already created a conditional group with a radio field that works perfectly, but there are situations where I need to handle it with checkboxes.
Is there any documentation that you are following?
I followed the documentation on the "Conditional Display for Form Inputs" page (https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/) and on "Advanced Conditional Display for Form Sections" (https://toolset.com/documentation/user-guides/cred-conditional-display-engine/)
On this last page, I see that there's a function named CONTAINS(array,value_mixed), but I don't know how to use it.
In my case, my checkboxes field has the slug "competences-fonctionnelles" with 13 possible answers for the user to chose from (it's possible to chose several boxes to check). The last possible answer is "Autre (à préciser)" with the value to save being "autre". So I thought it could be possible to check if the array associated with the field "competences-fonctionnelles" (if it's an array) contains "autre" and if it does, to show the conditional group.
I suppose I am doing something wrong with the way I am trying to use CONTAINS(array,value_mixed), could you help me understand how to use this function as a condition?
In the form, here is how I tried to achieve it:
<div class="form-group">
<label>Compétences fonctionnelles</label>
[cred_field field='competences-fonctionnelles' force_type='field' class='form-control' output='bootstrap']
</div>
[cred_show_group if="( $(competences-fonctionnelles) CONTAINS('autre','autre') )" mode="fade-slide"]
<div class="form-group">
<label>Autre compétence fonctionnelle</label>
[cred_field field='autre-competence-fonctionnelle' force_type='field' class='form-control' output='bootstrap']
</div>
[/cred_show_group]
What is the link to your site?
hidden link