Limit number of checked checkboxes using iCheck
问题 I'm using iCheck to style checkboxes and I'm having trouble using this along side validation. Basically I need to allow 3 checkboxes to be checked at a time and prevent further boxes from being checked. I've tried using this: $("#modal1").on("change", function() { var limit = 3, checkboxes = $(this).find("input:checkbox"), valid = checkboxes.filter(":checked").length >= limit; checkboxes.not(":checked").attr("disabled", valid); $('input').iCheck('update'); }); It works without iCheck as seen