Copy link to clipboard
Copied
Hello-
I have a parent dropdown with 3 dependents but I need only some items to show when certain items are selected. Code it quite long so here is a bit........what I need is when None is selected from the first dependant list, I only need 2 options to show, where as if any other selection is made I still need all options so show.
The highlighted items are what I need visible:
var f = this.getField("Additional Capabilities");
switch(event.value)
{
case "Absolute Pressure Decay, Occlusion, Verify": This is the parent dropdown
f.setItems(["-Select Additional Capability-",
"None", when this is selected
"Mass Flow",
"Ramp to Event",
"Mass Flow & Ramp to Event",
"Volumetric",
"Low Volume"]);
break;
case "Differential Pressure Decay, Occlusion":
var f = this.getField("Transducer Range");
switch(event.value)
{
case "Absolute Pressure Decay, Occlusion, Verify":
f.setItems(["-Select Transducer Range-",
"20 psia",
"45 psia",
"115 psia",
"215 psia",
"515 psia",
"other"]); I only need these 2 options selected, otherwise the entire list should show
break;
How do I make logic inside of logic if that makes sense?
Thank you so much, hope this make sense.
Nora
Copy link to clipboard
Copied
Use this code (adjust the values as needed of course) as the field's custom Validation script:
var f = this.getField("Transducer Range");
if (event.value=="None")
f.setItems(["Option 1", "Option 2"]);
else f.setItems(["Option 3", "Option 4", "Option 5", "Option 6"]);
Copy link to clipboard
Copied
Thank you--- I added/changed the code to the above and it changed the 2 dependent field to show 20 psia instead of staying at Select Transducer Range so I made a small adjustment and corrected that but it still shows the fill list of options, not just the 2 that I need:
Do I need to put code in a different order?
Copy link to clipboard
Copied
Replace all of your code with what I provided, only.
Copy link to clipboard
Copied
HI- Yes -- when I make the first selection from the parent dropdown it changes the transducer field immediately
Then when I select the addtl capabilities as "none" option, I get the entire list where I only need 2 options
However, I need the entire list when selecting any of the options from the parent drop down.
I've attached a copy of the form if that helps see what is happening.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you..... I may have taken it out since I needed a copy for a rush request and then sent you the wrong file. I appreciate you looking, reviewing and adding code. That is where I had it added so I must have had a small space or punctuation missing somewhere.