Skip to main content
lambo99
Participating Frequently
Mar 27, 2017 7:59 PM UTC
Answered

Create a drop down from a result

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.

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Mar 29, 2017 1:29 PM UTC

in the calculate section of the drowpdown box named "Series"


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...

8 replies

Bernd Alheit
Community Expert
Community Expert
Mar 28, 2017 9:59 AM UTC

For dropdown lists you must use setItems.

Translate
lambo99
lambo99Author
Participating Frequently
Mar 28, 2017 1:41 PM UTC

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;}

Translate
try67
Community Expert
Community Expert
Mar 28, 2017 2:06 PM UTC

Where did you place this code, and what's the full code?

Translate