My site has 6 dropdowns where the user makes a selection and on the back end, code filters the dataset and returns the information requested. I want to make 3 of these dependent dropdowns based off one (1) user input where it will filter the dataset which feeds the dropdown. How can this be done? I have tried this example (https://www.wix.com/corvid/forum/community-discussion/dependent-drop-down-lists) without success for two reasons:
-
I cannot get the dataset to filter based off user input
-
I want the value from 1 user input to be used in filtering up to 3 datasets
I am a beginner coder and am really struggling with this. I tried applying a “double filter” (shown below) with in the user input from both #dropdown2 and #dropdown3 and that did not work either.
$w("#dropdown3").onChange((event3) => {
let a = $w("#dropdown2").value;
let b = $w("#dropdown3").value;
$w('#dataset2').setFilter(wixData.filter()
.eq("modelYear2",a)
.eq("modelCode",b))
.then(()=>{
let c = $w("#dataset2").getCurrentItem().modelName;
console.log(c);
$w("#text29").text = c;
})
})
Any assistance is greatly appreciated!