Highlighted

Multiple Dropdowns from a single dropdown

Community Beginner ,
Oct 08, 2020

Copy link to clipboard

Copied

I am setting up a fillable PDF.  The users need a dropdown for Department, Division, and TrainingCodes.

Each Department has multiple divisions and training codes, so I would like to populate both Division and Training Codes based on the selection made in the Department dropdown.  Any ideas are appreciated!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

This is possible, but will require a custom-made script. The basic code to do it would be the following (from the Validation event of the first drop-down field):

 

if (event.value=="Dept1") {

this.getField("Division").setItems(["Dept1 Div1", "Dept1 Div2", "Dept1 Div3"]);

this.getField("TrainingCodes").setItems(["Dept1 TC1", "Dept1 TC2", "Dept1 TC3"]);

} else if (event.value=="Dept2") {

this.getField("Division").setItems(["Dept2 Div1", "Dept2 Div2", "Dept2 Div3"]);

this.getField("TrainingCodes").setItems(["Dept2 TC1", "Dept2 TC2", "Dept2 TC3"]);

}

 

etc.

TOPICS
Create PDFs, Edit and convert PDFs, PDF forms

Views

37

Likes

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

Multiple Dropdowns from a single dropdown

Community Beginner ,
Oct 08, 2020

Copy link to clipboard

Copied

I am setting up a fillable PDF.  The users need a dropdown for Department, Division, and TrainingCodes.

Each Department has multiple divisions and training codes, so I would like to populate both Division and Training Codes based on the selection made in the Department dropdown.  Any ideas are appreciated!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

This is possible, but will require a custom-made script. The basic code to do it would be the following (from the Validation event of the first drop-down field):

 

if (event.value=="Dept1") {

this.getField("Division").setItems(["Dept1 Div1", "Dept1 Div2", "Dept1 Div3"]);

this.getField("TrainingCodes").setItems(["Dept1 TC1", "Dept1 TC2", "Dept1 TC3"]);

} else if (event.value=="Dept2") {

this.getField("Division").setItems(["Dept2 Div1", "Dept2 Div2", "Dept2 Div3"]);

this.getField("TrainingCodes").setItems(["Dept2 TC1", "Dept2 TC2", "Dept2 TC3"]);

}

 

etc.

TOPICS
Create PDFs, Edit and convert PDFs, PDF forms

Views

38

Likes

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
Oct 08, 2020 0
Most Valuable Participant ,
Oct 09, 2020

Copy link to clipboard

Copied

This is possible, but will require a custom-made script. The basic code to do it would be the following (from the Validation event of the first drop-down field):

 

if (event.value=="Dept1") {

this.getField("Division").setItems(["Dept1 Div1", "Dept1 Div2", "Dept1 Div3"]);

this.getField("TrainingCodes").setItems(["Dept1 TC1", "Dept1 TC2", "Dept1 TC3"]);

} else if (event.value=="Dept2") {

this.getField("Division").setItems(["Dept2 Div1", "Dept2 Div2", "Dept2 Div3"]);

this.getField("TrainingCodes").setItems(["Dept2 TC1", "Dept2 TC2", "Dept2 TC3"]);

}

 

etc.

Likes

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
Reply
Loading...
Oct 09, 2020 1