Check All Button

I have done this very thing; create a "Check All" checkbox for a simulation. And the good news is that it is not very difficult. Basically the solution is a visual trick.What you need to do is create two identical sets of FORMS for the checkboxes on your page: * Form1: checkbox_1, _2, _3, etc. Set each box to YES intially visible, NOT initially selected, YES always on top* Form2: checkbox_1a, _2a, _3a, etc. Set each box to NOT initially visible, YES initially selected, YES always on top.Both of these forms should include the "Check All" checkbox, too (i.e., Form1: Check_All, Form2: Check_All_a). The only difference is that BOTH "Check All" checkboxes MUST be set to NOT always on top.The Labels for the checkboxes (text the student sees) should be identical, as should the placement on the page. In other words, all Form2 checkboxes and lables MUST precisely overlay their Form1 counterparts.You also need to create:* a variable called "ActiveCheckbox", with an initial value of one (1).* a small, transparent button that precisely overlays the Check All checkbox, set to YES intially visible, YES always on top. Leave the "On Click" tab action set to "none". This button must not be in either form, just on the page.Add six (6) "on mouse click" actions to the button:1) Reset Form12) Reset Form23) Toggle Visibility State Form14) Toggle Visibility State Form25) Modify Variable, "ActiveCheckbox", Set Value=1, Condition: ActiveCheckbox = 06) Modify Variable, "ActiveCheckbox", Set Value=0, Condition: ActiveCheckbox = 1When the student first selects the "Check All" box, they are really clicking the transparent button that sits on top. This will cause Form1 - which is initially visible - to hide, and Form2 - with everything already checked - to show, giving the appearance that all boxes have been selected. (Which is why you must precisely align your checkboxes.)On the second click of "Check All" the toggle switches, hiding Form2 and showing Form1 again, giving the appearance that all have been de-selected. Of course, at any time the student can select/deselect any individual checkboxes too.When the student presses whatever button executes your screen (e.g., submit, enter, etc.), base your response (i.e., feedback or other actions) using the value of the "ActiveCheckbox" variable:* If ActiveCheckbox = 1 then Form1 is being displayed and you should evaluate and act on the "on/off" values of checkbox_1, _2, _3, etc. But ...* If ActiveCheckbox = 2 then Form2 is being displayed and you should evaluate and act on the "on/off" values of checkbox_1a, _2a, _3a, etc.So it's just a little magician's "slight-of-hand", switching the set of checkboxes when the student isn't looking. :-) Good luck!- - DarylEdited By: DFleary on 2006-11-19 9:2:34

Discussions have been disabled for this post