Trying to write a case script that would drive a list into a pulldown which is no problem. The issue is that Pulldown box 1 drives the list in Pulldown box 2.
There are 20 choices in Pulldown box 1. 19 of those choices create exactly the same list in Pulldown box 2. Once of the choices in Pulldown box 1 creates a different and unique list in Pulldown box 2. So.....
If Case in pulldown box 1 = Option 1 then
pulldownbox2.Additem("choice 1");
pulldownbox2.addItem("choice 2"):
etc....
If Case in pulldown box1 = Anything other that Option 1 then
pulldownbox2.addItem("different choice 1")
etc
I want to avoid having to create a case of exactly the same list for 19 of the options if that makes sense.
Thanks -pc
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
You are very nearly there. You could run with this in the preOpen event of the DropDownField2:
// first clear DropDownField2
this.clearItems();
this.rawValue = null;
if (DropDownField1.rawValue == "Option 1")
{
// deal with the single case in the if statement
this.addItem("Choice 1");
this.addItem("Choice 2");
this.addItem("Choice 3");
}
else
{
// deal with the remaining 19 cases in the else statement
this.addItem("Choice A");
this.addItem("Choice B");
this.addItem("Choice C");
}
The above is JavaScript. It is recommended that script that determines the items should be placed in the preOpen event.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
You are very nearly there. You could run with this in the preOpen event of the DropDownField2:
// first clear DropDownField2
this.clearItems();
this.rawValue = null;
if (DropDownField1.rawValue == "Option 1")
{
// deal with the single case in the if statement
this.addItem("Choice 1");
this.addItem("Choice 2");
this.addItem("Choice 3");
}
else
{
// deal with the remaining 19 cases in the else statement
this.addItem("Choice A");
this.addItem("Choice B");
this.addItem("Choice C");
}
The above is JavaScript. It is recommended that script that determines the items should be placed in the preOpen event.
Hope that helps,
Niall
Views
Replies
Total Likes