Copy link to clipboard
Copied
I would like to create a form with a list of documents used for 3 different purposes. On the top of the form I will have a check box for each purpose that when clicked, it auto clicks the box next to the forms associated with that category. When a different purpose box at the top is clicked, the appropriate boxes next to the lists will automatically be checked as well. There will be documents in the list that will apply to all three of the purposes at the top and some that will only apply to one purpose. Is there a way to make this happen?
Copy link to clipboard
Copied
I would recommend using a button, not a check-box for this. It can be confusing for the user if the "ALL" box is checked, but not all the boxes that are connected to it are, or if they uncheck that box, and the others don't uncheck with it, for example.
To do it with a button use this code as its Mouse Up event:
var fieldsToCheck = ["CB1", "CB3", "CB4", "CB7"];
for (var i in fieldsToCheck) this.getField(fieldsToCheck[i]).checkThisBox(0, true);
Edit the fieldsToCheck array so it contains the actual fields for each button, for course.
Copy link to clipboard
Copied
Assume the purpose check boxes are named Purpose 1 through Purpose 3. Assume 4 form check boxes named Form 1 through Form 4. Assume all check boxes have an export value of "Yes". Use a custom calculation script in a text field that: First, unchecks all form check boxes then sets conditions for which ones should be checked. This way when the user selects or unselects any purpose check boxes, the correct form check boxes will be selected or unselected based on the purpose. You should also set all of the form check boxes to read only so they can't be overwritten.
var p1=this.getField("Purpose 1").value;
var p2=this.getField("Purpose 2").value;
var p3=this.getField("Purpose 3").value;
this.getField("Form 1").value="Off";
this.getField("Form 2").value="Off";
this.getField("Form 3").value="Off";
this.getField("Form 4").value="Off";
if(p1=="Yes")
{
this.getField("Form 1").value="Yes";
this.getField("Form 2").value="Yes";
}
if(p2=="Yes")
{
this.getField("Form 3").value="Yes";
}
if(p3=="Yes")
{
this.getField("Form 1").value="Yes";
this.getField("Form 4").value="Yes";
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now