I'm trying to limit the number of checkboxes that can be checked within a form, but am getting the following error:
Uncaught Error: Syntax error, unrecognized expression: input:checkbox[name=ninja_forms_field_57[terms]]
Here is the Javascript that I'm using:
// Main Category
var $checkboxes_to_limit2 = $("#taxonomy_47").find("input:checkbox[name=ninja_forms_field_47[terms]]");
$checkboxes_to_limit2.live("change", function() {
if($checkboxes_to_limit2.filter(":checked").length >= 3) {
$checkboxes_to_limit2.not(":checked").attr("disabled","disabled");
}
else {
$checkboxes_to_limit2.removeAttr("disabled");
}
});