Hi Yisrael,
Thank you for taking the time to assist me with this! I have very little experience working with code so your knowledge and time is most appreciated!!
I have added the snippet of code you provided me with to my site. The search feature still seems to work if I type in a correct zip code. However, if I type in a zip code not in the database it displays a blank result (nothing) and not the generic one I would like to have displayed. I am going to share the whole snippet of code with you to review and confirm I did add it correctly. If I did do that correctly, do you have any other suggestions or ideas to make this work?
Thanks again for your time!
Bryan
function search() {
wixData.query(‘ZipCodes’)
.eq(‘serviceZip’, $w(“#searchBar1”).value)
.find()
.then(res => {
$w(‘#repeater1’).data = res.items;
})
. catch ((error) => {
wixData.query(‘ZipCodes’)
.eq(‘title’, “000”)
.find()
.then(res => {
$w(‘#repeater1’).data = res.items;
})
});
}