Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Drop down list value dependant on value in another drop down list

Avatar

Former Community Member

Hi

I am not familiar with Java Script so if anyone can advise me on this I would be grateful.  I am using ADobe Livecycle V8.0.

I have two drop down lists - DDL1 and DDL2.

The choices in DDL1 are "High, Medium, Low, None"

The choices in DDL2 are "Positive, Negative, None"

If "None" is selected in DDL1 I want DDL2 to display "None". 

If any of the other values are selected in DDL1, then I don't want anything autofilled in DDL2.

Hope this makes sense!

Thank you.

2 Replies

Avatar

Former Community Member

This should do the trick:

in the "change" event of DropDownList1, put this:

if (xfa.event.newText == "None"){

DropDownList2.selectedIndex = 3; // at pos. 3, you should have "None"

                                                       // otherwise change here at your convenience

}

else {

DropDownList2.selectedIndex = 0; // here first element empty/default

                                                        // maybe you prefer the last one

}

Note that generally dropdown boxes have the first or last element empty/default; this way, when you script the "else" part, you can easily reset DropDownList2.

Avatar

Former Community Member

Hi mrfale67,

Just wanted to say thank for your help. After I spent a while figuring out the logic of your code it worked perfectly - so thank you for that, I appreciate it.

JDW