I already have to code, but I was wondering if someone knew how to set up a search feature on my website. I have 2 dropdown menus...1 for State/Province...the 2nd for City/Area. I just need to know how to set up that search feature in my database.
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Mr Tiaan
Have a look at his. You will need to replace the values in bold to the names in your site.
import {wixData} from 'wix-data'; export function button1_click(event, $w) { $w("#dataset1").setFilter(wixData.filter() .contains("state", $w('#dropdown1').value) .contains("city", $w('#dropdown2').value)) .then(() => { console.log("Dataset is now filtered"); $w("#repeater1").data = results.items; }).catch((err) => { console.log(err); }); }
0
Can you make a video tutorial for step by step where to upload it in wix? do I need to make a database for the country and city?
Hello!
You can also check this example: https://www.wix.com/code/home/example/Cascading-Form
I believe it does what you want
Hello mrobin
Have a look at his. You will need to replace the values in bold to the names in your site.
import {wixData} from 'wix-data';
export function button1_click(event, $w) {
$w("#dataset1").setFilter(wixData.filter()
.contains("state", $w('#dropdown1').value) .contains("city", $w('#dropdown2').value))
.then(() => {
console.log("Dataset is now filtered");
$w("#repeater1").data = results.items;
}).catch((err) => {
console.log(err);
});
}