<form onclick="sa();">
<div id="rates">
<input type="radio" id="r1" name="rate" value="0"> X1
<input type="radio" id="r2" name="rate" value="1"> X2
<input type="radio" id="r3" name="rate" value="2"> X3
</div>
</form>
When I click any radio button X1 X2 or X3, sa() is supposed to be called, which changes the limit from 3 to 2. (The alert window is for testing use.) Then the limit is used to restrict the number of checkboxes selected in the lower part. But the function doesn't work when I click the buttons; no alert window pops up, and I can still choose 3 boxes.
Another question I would like to ask: if a user has checked some boxes, but then s/he returns to the X buttons and select another one, I would like to have all boxes unchecked and s/he needs to check them again. What's code for this? Just add the uncheck function to the onclick?