I want to highlight any unchecked checkboxes when a form is submitted. I've got a total of six checkboxes in .new_order
, and I've started writing the function but I'm a bit stuck how to add a highlight class to each unchecked checkbox in .new_order
.
$('#orderconfirm').click(function () {
if ($('.modal .modal-body .new_order :checkbox').is(':unchecked') {
$(this).addClass('highlight');
}
});
Will this code iterate through each checkbox? I feel like I'm missing something. Also, this code has to disable the button until each checkbox is checked. Any help would be great!