• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit Search
0

How to make a dropdown selection select checkboxes

Community Beginner ,
Jan 27, 2023 Jan 27, 2023

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!

TOPICS
How to

Views

469

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 01, 2023 Feb 01, 2023

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
...

Votes

Translate

Translate
Community Expert ,
Jan 27, 2023 Jan 27, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2023 Jan 27, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 27, 2023 Jan 27, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2023 Jan 27, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 30, 2023 Jan 30, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 01, 2023 Feb 01, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 01, 2023 Feb 01, 2023

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 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Thank you so much!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

LATEST

Thanks I see I didn't read the question correct

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines