Last checkbox option in list disables all other checkboxes if checked
<script type="text/javascript">
var $checkboxes = $('#element-15 input[type=checkbox]');
var $last_checkbox = $checkboxes.last();
var x=$("#element-15 input[type=checkbox]").not(":eq(-1)");
x.each(function(){
$(this).prop("checked",true)
})
$checkboxes.on('change', function() {
if(this.id !== $last_checkbox[0].id) {
$last_checkbox.prop('checked', false);
}
});
$last_checkbox.on('change', function() {
var checkbox = $(this);
if(checkbox.prop('checked')) {
checkbox.parents('.field-checkbox')
.find('input[type=checkbox]:not(#' + this.id + ')')
.prop('checked', false);
}
});
</script>