I am creating a form and I want to limit the number of options people can choose (they need to choose exactly 5 options).
I found this:
$("#bla :checkbox").click(function() {
if($("#bla :checkbox:checked").length >= 5) {
$("#bla :checkbox:not(:checked)").attr("disabled", "disabled");
} else {
$("#bla :checkbox").attr("disabled", "");
}
});
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]
however I am unsure where to exactly put/edit this. Any assistance would be greatly appreciated!