Multiple sets of Dependent dropdowns in DC Pro
Hi,
I am trying to modify a script for dependent dropdowns, and am running into some issues. I have 4 drop downs. Box 2 is dependent on Box 1 and Box 4 is Dependent on Box 3. I can get Box 1 and 2 to populate and work; however when I try and add in the second set, it fails. It will either populate the 4th box based on the 1st box or not work at all.
My Script is as follows.
myBox1Values = ["", "1st Choice", "2nd Choice", "3rd Choice", "4th Choice"];
myBox3Values = ["", "A Choice", "B Choice", "C Choice", "D Choice"];
this.getField("Box1").setItems(myBox1Values)
this.getFiled("Box3").setItems(myBox3Values)
var DeptData = { "1st Choice": ["1st Choice-SubChoice1","1st Choice-SubChoice2"],
"2nd Choice": ["2nd Choice-Subchoice1", "2nd Choice-Subchoice2"],
"3rd Choice": ["3rd Choice-Subchoice1", "3rd Choice-Subchoice2", "3rd Choice-Subchoice3"],
"4th Choice": ["4th Choice-Subchoice1", "4th Choice-Subchoice2"]
"A Choice": ["A Choice-SubChoice1","A Choice-SubChoice2"]
"B Choice": ["B Choice-SubChoice1","B Choice-SubChoice2"]
"C Choice": ["C Choice-SubChoice1","C Choice-SubChoice2"]
"D Choice": ["D Choice-SubChoice1","D Choice-SubChoice2"]
};
function SetFieldValues(cDeptName)
{
this.getField("Box2").setItems(DeptData[cDeptName]);
this.getField("Box4").setItems(DeptData[cDeptName]);
}
This is paired with setting the field values for Box2 (in Box1)
if( event.willCommit )
{
if(event.value == "")
this.getField("Box2").clearItems();
else
SetFieldValues(event.value);
}
For Box4 (in Box3)
if( event.willCommit )
{
if(event.value == "")
this.getField("Box4").clearItems();
else
SetFieldValues(event.value);
}
What I cannot figure out is how to have two sets of dependent dropdowns in a single PDF using Adobe Acrobat DC Pro. I've done research and can find examples of three boxes all based off the first box, but cannot find anything about Multiple sets of dependent dropdowns.
Any assistance would be grateful.
Thank you,
