I want to limit checked checkboxes to 3, I couldn't do it if you can help that'd be a great favour.
<div class="col-md-4" dir="ltr" ><center>
<span class="button-checkbox">
<button type="button" style="width:200px;text-align: left;" class="btn" data-color="primary">'.$icon_image.' '.$group.' </button>
<input type="checkbox" name="icon[]" value='.$sgid.' />
</span>
I did try to write something here it is, also the checkboxes are echoed by php so it's depending on the mysql DB data.
var limit = 3;
$('input.icon[]').on('change', function(evt) {
if($(this).siblings(':checked').length >= limit) {
this.checked = false;
}
});