How to have a checkbox automatically populate other specific boxes.
Copy link to clipboard
Copied
Hi
I am new to creating forms but I am trying to edit a form we currently use so that if I check that specific box then certain boxes (yes boxes on the form) will automatically check when the first box at top of form is checked. Would this be possible
For example the box at the top is all clear and if that one is checked yes then all other yes boxes to be checked automatically.
Thank you for any help.
Copy link to clipboard
Copied
Hi
I am new to creating forms but I am trying to edit a form we currently use so that if I check that specific box then certain boxes (yes boxes on the form) will automatically check when the first box at top of form is checked. Would this be possible
For example the box at the top is all clear and if that one is checked yes then all other yes boxes to be checked automatically.
Thank you for any help.
Copy link to clipboard
Copied
is this an acrobat question?
Copy link to clipboard
Copied
Copy the check box fields so they have the same name same export value. You can copy the fields in form editing mode by selecting the field, then pressing Ctrl + c (copy), the Ctrl +v (paste).
Copy link to clipboard
Copied
Hi when i did this they all checked but then if i only wanted one box to work they all did due to the same name. Is there a way to add a script so that if the "all clear" box is checked then they check yes but if the "all clear" box is not checked then they will work as normal? Its for a vehicle inspection form so sometimes not everything is a yes but we wanted to see if it would be possible to have one box at the top that if when check will automatically populate all the others correctly so that the vehcile is considered all clear. I hope that makes sense?
Copy link to clipboard
Copied
I attached a picture of part of our form for reference. But on certain parts the check box would be a no instead of yes.
Example full tank yes
interior damage no
Copy link to clipboard
Copied
OK. You won't be able to copy the fields as a described. They need to have different names. What is the export value of the Yes boxes, "Yes"? If so, create Mouse Up action in the Actions tab of the AllClear check box, and select "Run a JavaScript". Then enter the following script:
if(event.target.value=="Yes")
{
this.getField("Checkbox 1").value="Yes";
this.getField("Checkbox 2").value = "Yes;
//etc.
}
Replace Checkbox 1 and Checkbox 2 with the actual field names.
Copy link to clipboard
Copied
Yes all the boxes have the export value as "yes"
Copy link to clipboard
Copied
So in this script would checkbox 1 be the allclear box or one of my other boxes? Sorry i am new to all this and still trying to figure it out so i want to make sure i don't mess up.
Copy link to clipboard
Copied
This script goes in the check box that controls the other boxes that it will check. The other boxes in the script are Checkbox 1 and Checkbox 2. Be aware that "Yes" is case sensitive.
Copy link to clipboard
Copied
Thank you for your help. I copied and pasted the script above and changed the checkbox names but i am getting an error message. I attached a picture of the javascript box
Copy link to clipboard
Copied
You have a 0 instead of a closing bracket after "InteriorNo" in your script.
Copy link to clipboard
Copied
If not sure about export values, it is better to check that checkbox is not "Off" or use 'isBoxChecked()'
if(event.target.value != "Off")
if(event.target.isBoxChecked(0))
and to check checkbox you can use
this.getField("Checkbox 1").checkThisBox(0,true);
Copy link to clipboard
Copied
Hi I added this script and it did check off the correct boxes but then when i unchecked it the other boxes remained checked. Is there a way to have all boxes uncheck as well if the original box is not checked?
Copy link to clipboard
Copied
That's what my first answer did, but you said you didn't want that. Here's the modified script:
if(event.target.value=="Yes")
{
this.getField("Checkbox 1").value="Yes";
this.getField("Checkbox 2").value = "Yes;
//etc.
}
else
{
this.getField("Checkbox 1").value="Off";
this.getField("Checkbox 2").value = "Off";
}
Copy link to clipboard
Copied
Thank you so much! This worked. I apologize I am new to all this so I don't think I fully understood when you asked me. Thank you again for all your help!
Copy link to clipboard
Copied
You need to ask program questions in the forum for the program you are using
To ask in the forum for your program please start at https://community.adobe.com/
Moving from Using the Community (which is about the forums) to the correct forum

