User Input DROPDOWN (connecting values to elements) Beginner HELP!

Hey everyone,

I am new to wix code and have a few questions! I would love the support from anyone who knows how to assist me!

Here we go:


I have a user input dropdown that I would like to link to the three “selection boxes”.


Naturally, if the user selects “1” from the dropdown, I would like the “One Selected” box to expand and the rest to collapse.
They are all currently set to collapsed on load, pending the users input.


The “selection boxes” have an ID of the following:
#ONEselected
#TWOselected
#THREEselected

The “dropdown” had an ID of the following:
#Choice1

Please help me figure out this code!

here is what I have that does not work, of course…

Hi Shaneice!

Please share a URL either to your site or to your editor so one of us, the Wix Code team, can inspect it and provide you with a solution.

Doron.

Thanks for the reply!
I am not comfortable sharing my url or editor.
Is that the only way to get an answer?

I pretty much need to know if I can connect the user input from a dropdown menu to a box that can be collapsed/expanded and if so, how?

I just need to know how to format the code to read the users input and if the #1 is selected, expand.

@shaneicewilliams rest assure that only authorized personnel can enter the link you’ve posted (in the case of editor).
I need to look at what kind of components you’ve used and the functionality flow in order to be able to suggest a solution.

After taking a look at the site you’ve shared I believe that you need to distinguish between the dropdown’s label (1/2/3), and the dropdown’s value (onecard/Twocards/Threecards).

After we’ve established the difference, I think your code should look something like that:

export function dropdown1_onChange(event) {
    if($w("#dropdown1").value === "onecard"){
       $w("#ONEselected").expand()
       $w("#TWOselected").collapse()
       $w("#THREEselected").collapse()
    } else if($w("#dropdown1").value === "twocard"){
            
            //and so on..
            
    }
}

Let me know if it works for you.

Doron.

@doron-alkalay you are AWESOME!!!

It works perfectly!!!

This is the 1st time I used the forum and im impressed!!! thanks so much!

im sure i will have other questions, until then, thanks so much my friend!

have a fantastic day!!


No problem at all, glad to be helpful!

Keep on Wixing!