Copy link to clipboard
Copied
I am trying to create a multiple option dropdown from a result in a previous box. for example. if you select "740" then you have can 1/2,3/4, or 1.0 if you select "560" then you can have 1.25, 1.5, or 2.0
var v1 = this.getField("Series").value;
if (v1 == 740) {
event.value = "1/2,3/4,1.0";}
only the 1/2 shows up and i need all three to be an option to select.
You need to use the Validation event. The Calculation event is triggered whenever the value of any field is changed.
So you would just keep re-applying the values to the fields if you do it like that...
Copy link to clipboard
Copied
For dropdown lists you must use setItems.
Copy link to clipboard
Copied
I used this statement and it creates a dropdown but it does not allow me to select anything other than my first option of "1/2-D" if i try to select something else it reverts back to "1/2-D"
switch (event.value) {
case "740":
this.getField("Inlet").setItems(["1/2-D","3/4-D","1.0-D","1/2-E","3/4-E","1.0-E","1.25-E","1.0-F","1.25-F","1.5-F","1.25-G","1.5-G","2.0-G","2.0-J","2.5-J","3.0-J"]);
break;}
Copy link to clipboard
Copied
Where did you place this code, and what's the full code?
Copy link to clipboard
Copied
I have a drop down box named "Series" with 4 options 740, 741, 742,743. in this drop down i wrote this code:
switch (event.value) {
case "740":
this.getField("Inlet").setItems(["1/2-D","3/4-D","1.0-D","1/2-E","3/4-E","1.0-E","1.25-E", "1.0-F","1.25-F","1.5-F","1.25-G","1.5-G","2.0-G","2.0-J","2.5-J","3.0-J"]);
break;}
I then have another dropdown box named "Inlet" where the results show up. From there i want to select one of those options and then create another dropdown named "Outlet"
In the "Inlet" dropdown i wrote this:
switch (event.value) {
case "1/2-D":
this.getField("Outlet").setItems(["1/2-D","3/4-D","1.0-D"]);
break;}
Copy link to clipboard
Copied
lambo99 wrote
I have a drop down box named "Series" with 4 options 740, 741, 742,743. in this drop down i wrote this code:
...
Where did you wrote the code?
Copy link to clipboard
Copied
in the calculate section of the drowpdown box named "Series"
Copy link to clipboard
Copied
You need to use the Validation event. The Calculation event is triggered whenever the value of any field is changed.
So you would just keep re-applying the values to the fields if you do it like that...
Copy link to clipboard
Copied
That worked perfect. Thank you very much
Find more inspiration, events, and resources on the new Adobe Community
Explore Now