Copy link to clipboard
Copied
Hello,
I am using Adobe Pro DC and attempting to create a form with IF/THEN statements and dropdown lists. I have looked at all of the similar questions in the community, but was unable to find exactly what I needed.
Here's what is needed:
Dropdown 1 will list men, women, or children.
Drowdown 2 will list shirt sizes based on the selection in dropdown 1.
So IF children is selected in Dropdown 1, how do I make sure that ONLY certain options are available in Dropdown 2?
Thank you!
Copy link to clipboard
Copied
Hi! I actually found a youtube video tutorial that had exactly what I was looking for. Here's my code and it works.
var genderlist = this.getField("Gender");
if(event.willCommit)
{
switch (event.value){
case "Man":
genderlist.setItems(["-Select Size", "Small", "Medium", "Large", "XL", "2XL"]);
break;
case "Woman":
genderlist.setItems(["-Select Size", "Small", "Medium", "Large", "XL", "2XL"]);
break;
case "Child":
genderlist.setItems(["-Select Size", "2T", "3T", "4T", "5T", "X-Small"]);
break;
}
}
Copy link to clipboard
Copied
Sorry, I forgot to mention that I input this into Dropdown 1 under Custom Keystroke Script.
Copy link to clipboard
Copied
So you want to load a list (i.e. dropdown) based on the selection from another list?
This has be asked many times. Here are some articles, with examples, that cover this issue.
https://acrobatusers.com/tutorials/js_list_combo_livecycle/
https://acrobatusers.com/tutorials/change_another_field/
https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm
Copy link to clipboard
Copied
Hi! I actually found a youtube video tutorial that had exactly what I was looking for. Here's my code and it works.
var genderlist = this.getField("Gender");
if(event.willCommit)
{
switch (event.value){
case "Man":
genderlist.setItems(["-Select Size", "Small", "Medium", "Large", "XL", "2XL"]);
break;
case "Woman":
genderlist.setItems(["-Select Size", "Small", "Medium", "Large", "XL", "2XL"]);
break;
case "Child":
genderlist.setItems(["-Select Size", "2T", "3T", "4T", "5T", "X-Small"]);
break;
}
}
Copy link to clipboard
Copied
Sorry, I forgot to mention that I input this into Dropdown 1 under Custom Keystroke Script.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more