I have seen related if not identical posts in here but I cannot still figure out the solution. I would appreciate any help. I am using LiveCycle ES2.
I have two dropdown lists: Province and City
Province contains (say) Alberta, Toronto, Manitoba
City has (say) A, B, C, D, E, F, G, H, I, J, K
I want the City (dropdown list) to behave in this way:
How do I write the script for this? Again, thank you very much for the help.
PeeGee
Views
Replies
Total Likes
Hi,
Try this JavaScript in the preOpen event of the city dropdown (which I have called CitiesDropDown and called the provinces one ProvincesDropDown)
var cities = [];
switch (ProvincesDropDown.rawValue)
{
case "Alberta":
cities = ["A", "B", "C"];
break;
case "Toronto":
cities = ["D", "E", "F", "G"];
break;
case "Manitoba":
cities = ["H", "I", "J", "K"];
break;
}
CitiesDropDown.clearItems();
cities.forEach(function(element) { CitiesDropDown.addItem(element); });
Regards
Bruce
Views
Replies
Total Likes