Maximum number of checks in checkboxes
November 7, 2009 12:00 AM
Ok, here we go. I have not developed this but this would be my approach. I know of no way to make the check boxes grayed out. If you can come up with a grayed out graphic, you could replace the transparent button below. It would not be easy because you would have to align the grayed out image with the original check box.
1. Create 9 small transparent buttons, place one over each check mark. Make them initially not visible. Each runs an action group that displays your "Limit of 5 check boxes" message. This way you have only one action that has the message so if you want to change the message, you only have to change one action.
2. Create an action group called "count_checks". It begins by setting a variable to 0, say _count. This is followed by one action for each checkbox that adds one to _count IF (the condition tab) the checkbox is on. The last action in this group would run a second action group (block_checks) if _count = 5. You will have to create the block_checks action group first before you can create this action.
3. Create an action group called block_checks which has one action for each checkbox. The action Shows the transparent button for the checkbox IF the checkbox is off. This way you block further checkboxes once 5 is reached. If they click on the check box, then they actually click on the transparent button and the msg shows.
4. Finally, on each of the checkboxes on the On Select/Change tab, run the count_checks action group.
5. Because people can leave the page and come back, you want to be sure they cannot out smart the system so you have to have a page level On Show action that runs the count_checks action group.
Build this for 3 check boxes first and get it to work. THEN just copy the actions and do the remaining 6 checkboxes. Usually saves time.
Discussions have been disabled for this post