Dynamic Dropdown Reverts to Default Value, Does Not Hold Selected Value
I am trying to create a form in Adobe Acrobat XI Pro with three drop downs, two of which are dependent upon the selection made in the drop down before it.
Given that I've never done anything of this nature previously, I have followed the advice given in this thread but am having an issue that didn't seem to come up there, and I couldn't find anything similar in other threads.
The population of the dynamic drop down menus works fine, but I'm having trouble getting the values selected in the second and third drop downs to "stick".
Initially, I did not set the field to "Commit selected value immediately", which allowed my selection to be made and held until I clicked out of the second drop down, then it reverted to the initial/top value in the list but the options in the third drop down were still related to the selection made but as soon as any selection is made, it also reverts based on the second drop down's reverted value. If I select "Commit selected value immediately in the options, my selection is instantly reverted without having to click out of the field.
Any help would be greatly appreciated!
Here is the code I've entered in the "Custom calculation script" boxes for the first two drop downs:
//Drop1 - Initial selection sets options in second drop down
switch(event.value){
case "A":
this.getField("Drop2").setItems(["A1","A2","A3"]);
break;
case "B":
this.getField("Drop2").setItems(["B1","B2","B3"]);
break;
case "C":
this.getField("Drop2").setItems(["C1","C2","C3"]);
break;
}
//Drop2 - Secondary selection sets options for third drop down
switch(event.value){
case "A1":
this.getField("Drop3").setItems(["A1a","A1b","A1c"]);
break;
case "A2":
this.getField("Drop3").setItems(["A2a","A2b","A2c"]);
break;
case "A3":
this.getField("Drop3").setItems(["A3a","A3b","A3c"]);
break;
case "B1":
this.getField("Drop3").setItems(["B1a","B1b","B1c"]);
break;
case "B2":
this.getField("Drop3").setItems(["B2a","B2b","B2c"]);
break;
case "B3":
this.getField("Drop3").setItems(["B3a","B3b","B3c"]);
break;
case "C1":
this.getField("Drop3").setItems(["C1a","C1b","C1c"]);
break;
case "C2":
this.getField("Drop3").setItems(["C2a","C2b","C2c"]);
break;
case "C3":
this.getField("Drop3").setItems(["C3a","C3b","C3c"]);
break;
}
