Hi everyone!
I am very new to coding and am trying to create a search journey where the user fills out the search criteria on the homepage ( 2 dropdowns and a geo location input) and then have the search results be shown on a separate page filled with repeaters. Also, to have the page show the search criteria selected by the user at the top of the page.
Below is the code I have for the homepage, so far, where the user inputs are saved on a form dataset and that are displayed on the search results page. #dataset4 is where the searchable content is held and the dropdown selections are in boolean values, since each row can have multiple values from the dropdown selection. I am not sure if the code I have so far is correct or how to finish it. I have gone through a few tutorials/forums for help but haven’t been able to get anything concrete yet. Any help or guidance is very much appreciated.
import wixData from ‘wix-data’;
import {local} from ‘wix-storage’;
$w.onReady( function () {
});
export function searchbutton_click(event) {
let filterStore = $w(“#Techniquedropdown”).value;
$w(“#dataset4”).onReady(() => {
if (filterStore === “VEGAN”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“vegan”, true ));
}
if (filterStore === “MEMORIAL INK”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“memorialInk”, true ));
}
if (filterStore === “HAND POKE”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“handPoke”, true ));
}
if (filterStore === “NEEDLE”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“needle”, true ));
}
})
let filterStore = $w(“#tattootypedropdown”).value;
$w(“#dataset4”).onReady(() => {
if (filterStore === “VEGAN”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“vegan”, true ));
}
if (filterStore === “MEMORIAL INK”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“memorialInk”, true ));
}
if (filterStore === “HAND POKE”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“handPoke”, true ));
}
if (filterStore === “NEEDLE”) {
$w(“#dataset4”).setFilter(wixData.filter().eq(“needle”, true ));
}
})
export function addressInput1_change(event) { //Add your code for this event here: }
}