Copy link to clipboard
Copied
Hello,
Curious if it's possible to make a specific dropdown selection also populate specified checkboxes later on a .pdf form? Other options within the dropdown should not check any boxes. Is this possible? Thanks!
Copy link to clipboard
Copied
In the dropdown field under 'Options' tab, check 'Commit selected value immediately' if you want the script to trigger without the need to click outside the field once you make the choice.
Use this as 'Validation script of dropdown field:
this.getField("Unbundled").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box28").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box29").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box30").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box26").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box32").checkThisBox(0,event.value == "DB" ? true : false);
And here is your file with script added:
https://drive.google.com/file/d/1k_VO9gnLuMP3EdHsDPkvQD46eT9qN5DU/view?usp=share_link
Copy link to clipboard
Copied
Use this:
this.getField("Staffing Needed").checkThisBox(0, event.value=="High*" || event.value=="Very High*");
Copy link to clipboard
Copied
Yes it is if you know JavaScript, and the document object model. But it will only work when viewing the PDF in Acrobat, though.
Copy link to clipboard
Copied
Where exactly do you need this to work? Do you have control over the application that will be used to fill the form?
Copy link to clipboard
Copied
I attached the document I'm looking at, I need when "DB" is selected in 'Type of Plan' that all of the other highlighted check boxes become checked. Sorry I should have attached the doc for context; would it still be possible?
Copy link to clipboard
Copied
++ Adding to the discussion,
You can do that very easily with a script.
But what do you need to happen to the highlighted checkboxes when the user goes back and unchecks the DB checkbox?
Do you also need all of those checkboxes to become unchecked or leave them checked?
Copy link to clipboard
Copied
Oh, that's great news! I would like for when 'DB' is selected in type of plan that the following options become checked:
- Unbundled
- N/A - Unbundled
- N/A
- N/A
- N/A - Unbundled DB
- N/A - Unbundled DB
And of course if something else is selected from the dropdown, these all become unchecked.
Copy link to clipboard
Copied
Make a structure to see what the checkboxes are called:
You would beed something like:
var myBox = this.getField("R1");
var myBox2 = this.getField("R2");
if (myBox.value === "Yes") {
myBox2.value = "Yes";
}
if (myBox.value !== "Yes") {
myBox2.value= "";
}
Where R1 is the box you woould check and R2 is the box that is contolled by checking box R1.
I like to define the veriables to make script more reusable.
Copy link to clipboard
Copied
In the dropdown field under 'Options' tab, check 'Commit selected value immediately' if you want the script to trigger without the need to click outside the field once you make the choice.
Use this as 'Validation script of dropdown field:
this.getField("Unbundled").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box28").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box29").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box30").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box26").checkThisBox(0,event.value == "DB" ? true : false);
this.getField("Check Box32").checkThisBox(0,event.value == "DB" ? true : false);
And here is your file with script added:
https://drive.google.com/file/d/1k_VO9gnLuMP3EdHsDPkvQD46eT9qN5DU/view?usp=share_link
Copy link to clipboard
Copied
Thank you so much!!
Copy link to clipboard
Copied
Thanks I see I didn't read the question correct
Copy link to clipboard
Copied
I have a similar situation in that I would like only 2 out of 5 drop down options ("High" and "Very High") to trigger the same checkbox ("Staffing Needed"). I am using the following script:
this.getField("Staffing Needed").checkThisBox(0, event.value=="High*")
this.getField("Staffing Needed").checkThisBox(0, event.value=="Very High*")
This works with one option ("Very High") but not both. I am unsure as to how to make it so that both options (High and Very High) will prompt the checkbox. Is there a way to write both options into the script? Thank you.
Copy link to clipboard
Copied
I obviously am not an expert in this either but I'll try and pay it forward! Perhaps try separating the commands with a semicolon or if that doesn't work, try "or" instead of a semicolon.
Blind leading the blind here but maybe it'll work.
Copy link to clipboard
Copied
Thank you for the response and suggestions. I did try both and unfortunately neither worked.
Copy link to clipboard
Copied
Use this:
this.getField("Staffing Needed").checkThisBox(0, event.value=="High*" || event.value=="Very High*");
Copy link to clipboard
Copied
Thank you very much! It worked.
Copy link to clipboard
Copied
Hi,
I want kind of same thing to happen. The dropdown name is "Dropdown2" and it has 2 values, yes and no. and there is a checkbox "checkbox2", i want this checkbox to be checked whatever option you choose from the dropdown. Can you please write the complete script, so i just copy and paste. thank you
Copy link to clipboard
Copied
This doesn't make much sense to me, if there are only 2 values in the dropdown and checkbox will be checked no matter what selection is made, why not just check the checkbox manually and leave it checked?
Copy link to clipboard
Copied
It is a whole sheet with different tasks on it. I will do the rest, just wanted to had an idea. If i get it done by your help i will do the rest. It's a list of tasks, so task should be checked when you select an option from the dropdown. Hope you understand now.
Copy link to clipboard
Copied
As validate script of dropdown you can use this:
if(event.value == "yes" || event.value == "no")
this.getField("checkbox2").checkThisBox(0,true);
Copy link to clipboard
Copied
It didn't work.
Copy link to clipboard
Copied
Are your values "yes" and "no" or "Yes" and "No"?
Copy link to clipboard
Copied
Yes and No
Copy link to clipboard
Copied
it worked now. thank you
Copy link to clipboard
Copied
one last question, if i have 3 values in dropdown, for example, "None". How would you do it? Thank you
Copy link to clipboard
Copied
If "None" is selected, you want to uncheck checkbox?
You can use this to uncheck if "None" is selected and check if "Yes" or "No" is selected:
this.getField("checkbox2").checkThisBox(0,(event.value == "Yes" || event.value == "No")? true : false);


-
- 1
- 2