Hi @pete851
Thank you for response!
You’re right, this apparently causes sort of “condition loop”, I’m sorry about that.
It’s still achievable but will require additional code to be added to the site. Here’s how:
1. Keep th form as is – with that single checkbox with three options (instead of breaking checkbox to three separate checkboxes)
2. edit that checkbox field and in its “styling” settings section add this to “Additional CSS Classes” option
wpmudev-option-limit
note: no dot at the start
3. add this code as an MU plugin to the site
https://gist.githubusercontent.com/wpmudev-sls/5be7b5f7eac4132e1539b850b8ab751c/raw/7e55d4ae307cc62eb01d25fe06df930ceb5ae481/wpmudev-fm-restrict-select-multiple-field.php
– create an empty file with a .php extension (e.g. forminator-limit-checkbox-choice.php)
– copy and paste code into it
– in this line replace number 791, 9034 with an ID of the form in question (should be the same as number that you see in form’s shortcode)
form_ids: [791, 9034],
so for example if your form ID is 123 this line should be
form_ids: [123],
– replace this
<style>
.forminator-ui .wpmudev-option-limit .wpmudev-disabled{
color:#ddd!important;
}
.forminator-ui .wpmudev-option-limit .wpmudev-disabled span[aria-hidden]{
border-color: #ddd!important;
background-color: #ddd!important;
}
</style>
with this
<style>
.forminator-ui .wpmudev-option-limit .wpmudev-disabled{
display:none!important;
}
.forminator-ui .wpmudev-option-limit .wpmudev-disabled span[aria-hidden]{
display:none!important;
}
</style>
– replace this
limit: {
'checkbox-2': 5,//[field-id]:[limit]
'select-1': 1
},
with this
limit: {
'checkbox-1': 1//[field-id]:[limit]
},
– save the file and upload it to the “/wp-content/mu-plugins” folder on your server, in your site’s WordPress install directory
Assuming that your checkbox is checkbox-1 and you’ve set correct form ID, it should work out of the box.
Best regards,
Adam