I am facing a problem with the validation of the group of my checkboxes.
my code looks like this:
<script>
$('div.checkbox-group.required :checkbox:checked').length > 0
</script>
<figure class="fig">
<label>
<div class="order">19</div>
<p>MDU Floor Layout<span class="asterisk">*</span></p>
</label>
<br>
<fieldset id="opfloorlayout" class="checkbox-group required" required>
<div>
<input type="checkbox" id="opbasement" name="mdu_floor_layout" value="Basement">
<label class="checking" for="opbasement">Basement</label>
</div>
<div>
<input type="checkbox" id="opcarpark" name="mdu_floor_layout" value="Underground car park">
<label class="checking" for="opcarpark">Underground Car Park</label>
</div>
<div>
<input type="checkbox" id="opintake" name="mdu_floor_layout" value="Intake cupboard">
<label class="checking" for="opintake">Intake Cupboard</label>
</div>
<div>
<input type="checkbox" id="opriser" name="mdu_floor_layout" value="Riser cupboards">
<label class="checking" for="opriser">Riser Cupboards</label>
</div>
<div>
<input type="checkbox" id="opfceiling" name="mdu_floor_layout" value="False Ceiling">
<label class="checking" for="opfceiling">False Ceiling</label>
</div>
<div>
<input type="checkbox" id="opnothing" name="mdu_floor_layout" value="No riser or intake cupboard">
<label class="checking" for="opnothing">No Riser or Intake Cupboard</label>
</div>
</fieldset>
<br>
</figure>
I tried mainly this solution, which suits best to me:
Using the HTML5 "required" attribute for a group of checkboxes?
but I don't know why the validation is not recognized by my browser?
What am I doing wrong here?