Checkboxes – limit # that can be checked
-
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!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Checkboxes – limit # that can be checked’ is closed to new replies.