I have a checkboxes field with two options. By default they are unchecked. The user only gets access to certain areas, if the according option is selected in the checkboxes field as checked.
I try to create a CRED form and after the form submission one of the selected options should be checked - while the entrire checkboxes field should stay invisible.
Can I achieve this somehow with javascript? I did an extensive research here in the forum, but I couldn't find a useful solution.
Is there any documentation that you are following?
no
Is there a similar example that we can see?
no
What is the link to your site?
Site under development
Please elaborate the questions with more details:
I try to create a CRED form and after the form submission one of the selected options should be checked - while the entrire checkboxes field should stay invisible.
How do you setup the custom checkboxes field?
How do you want to setup "after the form submission one of the selected options should be checked"?
Where and how do you want to set "the entrire checkboxes field should stay invisible"?
[credform]
<div style="display: none;">
<!-- select option 1 in the following checkboxes field. The user shouldn't see it, so I need to select something on his behalf -->
[cred_field field="rechte-benutzer" force_type="field" class="form-check-input" output="bootstrap"]
</div>
[cred_field field='form_submit' output='bootstrap' value='JA, BITTE FREISCHALTEN' class="Ort_betreten"]
[/credform]
If [cred_field field="rechte-benutzer" force_type="field" class="form-check-input" output="bootstrap"] would be a select field,
I would set it up with value="option1". I never did something like that with Checkboxes, so I am a little bit lost...