Using the HTML5 “required” attribute for a group of checkboxes?
Unfortunately HTML5 does not provide an out-of-the-box way to do that. However, using jQuery, you can easily control if a checkbox group has at least one checked element. Consider the following DOM snippet: <div class=”checkbox-group required”> <input type=”checkbox” name=”checkbox_name[]”> <input type=”checkbox” name=”checkbox_name[]”> <input type=”checkbox” name=”checkbox_name[]”> <input type=”checkbox” name=”checkbox_name[]”> </div> You can use this expression: $(‘div.checkbox-group.required … Read more