Skip Navigation

[Resolved] Only be able to select one checkbox

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 0 replies, has 1 voice.

Last updated by Pete 5 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1311719

Hi there,

On this test page we have a selection of check boxes we are testing out as part of a filtered search:
hidden link

Is there a way of making it that only one check box can be selected in each group?

I have seen this asked before and the blow was given as a solution however my code looks different to what was shown:
https://stackoverflow.com/questions/19001844/how-to-limit-the-number-of-selected-checkboxes

I have the below code in the Views > Search and Pagination area...

<div class="form-group">
<label>[wpml-string context="wpv-views"]Guests[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="guests" type="checkboxes" url_param="wpv-guests"]
</div>
<div class="form-group">
<label>[wpml-string context="wpv-views"]Collections[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="collection" type="checkboxes" url_param="wpv-collection"]
</div>
<div class="form-group">
<label>[wpml-string context="wpv-views"]Pets[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="pet" type="select" default_label="Any" url_param="wpv-pet"]
</div>
<div class="form-group">
<label>[wpml-string context="wpv-views"]Area[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="area" type="select" default_label="Any" url_param="wpv-area"]
</div>