Two or more dependent lists by one main list
Hi, this is my problem. In my pdf document, I want a main dropdown list "mainList" and a dependent dropdown list "depList1". When I choose the value in "mainList", the values in "depList1" change. In "mainList" I use this script, with three values "0", "1" and "2" that show different choices in "depList1", with the relative values:
var dependentListBoxFieldName = "depList2";
var dependentListValues =
{
"0": [
[" ", "0"]
],
"1": [
[" ", "0"]
["white", "1"],
["green", "2"],
["red", "3"],
],
"2": [
[" ", "0"]
["white", "1"],
["blue", "2"],
["yellow", "3"],
};
if ((event.target.type == "combobox" && event.name == "Format") || (event.target.type == "listbox" && event.name == "Keystroke")) {
if (event.target.type == "combobox") {
if (dependentListValues.hasOwnProperty(event.target.value)) {
this.getField(dependentListBoxFieldName).setItems(dependentListValues[event.target.value]);
}
else {
this.getField(dependentListBoxFieldName).clearItems();
}
}
if (event.target.type == "listbox" && dependentListValues.hasOwnProperty(event.changeEx)) {
this.getField(dependentListBoxFieldName).setItems(dependentListValues[event.changeEx]);
}
}
else {
app.alert("This script was not intended for this field type or event.");
So, I want a second dropdown list "depList2" that changes its values together "depList1", when I change the choose in "mainList". In other words, I want two or more dependent dropdown lists all dependent by only one main list. Can I use the same script? Can I use another script? Thank you so much
