Hello all,
I have two dropdowns, a search button and a reset button.
I would like that the user can select a value in :
- the first dropdown (origin) only
- or second dropdown (classification) only
- or both (origin and classification)
My actual code is :
import wixData from 'wix-data'; export function button1_click(event) { search(); } function search() { wixData.query("VideoAll") .eq("origin", String($w("#dropdown1").value)) .and(wixData.query("VideoAll").eq("classification", String($w("#dropdown2").value))) .find() .then(results => { $w("#Badgerepeater").data = results.items; }); }
If I only select something in the first dropdown (origin) and click on search then it works.
If I select something in the first (origin) and second (classification) dropdown then it also works.
But if I only select something in the second (classification) dropdown then it doesn't work.
Can you help me to fix this ?
Thank you all
You will need to put your code where I left the comments. For example, your `wixData.query` code should be in the last `else` statement