Updating multiple drop down list fields based on selection from single drop down list field
I'm using Acrobat Pro DC 2020 and am having trouble working with dependent drop-down fields. I have a drop-down field called "Department" and have several departments to choose from in that list. I then have 13 different drop-down fields called "Account1, Account2, etc." When choosing Department A on the first drop-down list, I'd like the 13 dependent drop-downs to have a specific list of choices. If I choose Department B on the first drop-down list, I'd like the 13 dependent drop-downs to have a different specific list of choices.
I have working code that causes the drop-down list for Account1 to change based on the selection from the Department drop-down list. I can't figure out how to make the selection from the Department drop-down list affect Account1, Account2... all the way to Account13.
Here is what I have now (that isn't working). The code is placed on the Format tab - Custom Format Script in the Properties of the Department field:
if(event.value == "Technology")
{
this.getField("Account1").setItems(["--","Computers","Printers","Scanners"]);
this.getField("Account2").setItems(["--","Computers","Printers","Scanners"]);
}
else if(event.value == "Marketing")
{
this.getField("Account1").setItems(["--","Mail","Television","Posters"]);
this.getfield("Account2").setItems(["--","Mail","Television","Posters"]);
}
else
{
this.getField("Account1").clearItems();
this.getField("Account2").clearItems();
}
I'm hoping that someone can tell me what I'm missing. Thanks for any help you can provide.
