Hi, so I have an advanced search system on one page on my site. Users can filter data in a repeater using dropdowns, inputs, sliders.
I also have a search bar in the footer on my website.
I would like users to be able to search in that search bar on any page, and the result to appear on the advanced search system page.
I got code from here:
https://www.wix.com/velo/forum/community-discussion/trigger-button-click-using-enter-key
And here:
https://www.wix.com/velo/forum/community-discussion/exporting-text-from-input-box-to-another-input-box-on-another-page.
Here is my code:
Master page
import {local} from 'wix-storage';
import {session} from 'wix-storage';
import wixData from 'wix-data';
export function button30_click(event) {
const searchTerm = $w('#input12').value
local.setItem("searchTerm", searchTerm);
}
export function input12_keyPress(event) {
console.log("You pressed" + event.key);
if (event.key === "Enter") {
button30_click(event); // pressing <Enter> activates the button1() function ... same effect as clicking the button
} else {
//
}
}
Advanced search system page
export function input1_keyPress(event) {
console.log("You pressed" + event.key);
if (event.key === "Enter") {
button29_click(event); // pressing <Enter> activates the button1() function ... same effect as clicking the button
} else {
//
}
}
$w.onReady(function () {
$w('#input1').value = local.getItem("searchTerm");
})
I am completely stumped to why this is not working.
Could anyone help?