1
2
3
4
5
6
7
8
9
10 [special rules applied to 10 for this example]
 
Note: If 3 or more are selected and then checkbox 10 is clicked, an alert is given on that event-trigger and the click on 10 is canceled. If 0,1, or 2 are checked and then box 10 is checked then the check event is allowed and item 10 will be allowed to have a check remain in it.
If you want this event trigger, then you need to have the onclick="return validate()" inserted into each checkbox that you want to trigger the validation.
Otherwise, when the form is submitted it [click submit form] the validation event is triggered and the check box count is counted...