Hi, is there any way for us to limit the # of checkboxes a user can select in a given subcategory? If not what would be a good place to start. I want to limit the # of selections on each click, comparing the # of boxes checked in that sub-cat with another variable and throwing up an alert if they have reached a limit.
thanks in advance, mike
2) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.173.--.--
Posted:
Whoo, I haven't edited this script in quite a while :). I'd check in the click handler, count the sibling elements of the clicked one, and if there's too many cancel the click event. That's a fair amount of programming though, not a one-line addition.
- Angus.
3) mikeGroup: Guests IP: 66.207.--.--
Posted:
thanks for the info. thats what i was planning on doing. I figure just right at the top of the click event i would first determine if they are checking or unchecking. if checking count siblings in the sub-section, if count of siblings > max checked then break otherwise allow the click and increment counter.
i noticed you do have a count function in there that (when enabled) does a count of the # of boxes checked, i may see if i can hook into that and just enforce a max count check before it updates the status.