Create one Checkbox that checks all checkboxes

I would basically like to create a checkbox that when selected will result in "checking" all other boxes on form. "Select All" = placing checkmark on 28 other checkboxes. the 28 other checkboxes should be able to be selected individually as needed. Adobe Acrobat 10.1.2 on Mac Lion


ozmirand


4 Answers

Voted Best Answer

You should create a MouseUp event on your "Select All" check-box, which test its value, and then iterates over the other boxes, setting their state. Something like this:

var otherCheckBoxes = ["CheckBox1", "CheckBox2", "CheckBox3"]; // etc.
if (getField("Select All").value!="Off") {
for (var i in otherCheckBoxes) getField(otherCheckBoxes[i]).checkThisBox(0,true);
}


By Gilad D (try67)   

Hi,

you can use the Adobe form field naming convention, that use dots to separate fields' names.
As :
myform.checkbox.0
myform.checkbox.1
myform.checkbox.2
myform.checkbox.3

And so on.


Then you can use this script :

this.getField("
myform.checkbox").checkThisBox(0,true);

;-)


JR Boulay   

How does this work in reverse; if for instance 3 particular checkboxes are selected, the third one selects a particular fourth one?


Timothy Hartwell   



You can do the same in LiveCycle without all the JavaScript.

All you do is set up the action for the first checkbox to select all three.

In the condition make sure the first checkbox is set to click

Then in the results select Set Value of the field and select the second checkbox and it will automatically be to checked. Then repeat the process for the 3rd and forth checkboxes and you are good to go.

If I am understanding your second question, just repeat the process to make the connection to the third box to the 4th one. Of course, if you want to deselect the all the boxes, just set up the condition and results to uncheck.


Michael Anderson   


Please specify a reason: