Dropdown options

I know this may bu very easy for most of you, but i cant figure our how i can link two Dropdowns and depending on the selection of the first the options of the second will be limited.

for example:

let’s say i have a dropdown with Cars options like: Ford, Opel and Mercedes.

then i have another dropdown with the models which are: Fiesta, Astra and Ml350

when a user selects the option Ford, I want the following dropdown to select for me only the option ”Fiesta” and the same with Opel = Astra
and Mercedes = Ml350

thanks

Hi,

Welcome to Wix Code.

Take a look at the Cascading Form example to see how this is done.

Good luck,

Yisrael

That’s super!!! I’ve got it!
Thank you so much! :)))))))

Yisrael, thanks this is what I needed also!! one variation I need also is substituting a database field for the states.js import. is that possible?

TY

Hey there TY,

All you need to do is to connect your dropdown list to a dataset, that connects to the collection that has the list of options you want to appear in the dropdown.

For an example, see the section Search Using a Dropdown Element in the tutorial How to Use Code to Let Your Users Search a Collection . That should get you going.

Good luck,

Yisrael

thanks so much! i’ll check it out this evening!