Hi all, I have attempted to edit existing code I have on my website in order to allow users to search a different data set. I am so not great at coding and am having difficulty - it seems like it should work (to me) and yet…any ideas?
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
$w ( “#input2” ). onChange (() => {
filterData ();
})
$w ( "#input1" ). onInput (() => {
filterData ();
})
**function** filterData () {
**let** filterBuilder ;
**if** ( $w ( "#input2" ). value ) {
**let** address = $w ( "#input2" ). value ;
filterBuilder = wixData . filter (). gt ( "address" , $w ( "#input2" ). value )
} **else** {
filterBuilder = wixData . filter (). contains ( "Userstate" , $w ( "#input1" ). value )
}
$w ( "#text29" ). text = "Oops! No matches found..."
$w ( "#text30" ). text = "Search for another city near you to find matches."
}
})
$w ( "#repeater4" ). onItemReady ( **async** ( $item , itemData , index ) => {
**var** userState = itemData . userstate ;
$item ( "#text31" ). text = "Playgroup Name" + itemData . lastname ;
$item ( "#text10" ). text = "Location" + itemData . address + " (" + itemData . UserState + ")" ;
$item ( "#text259" ). text = "Meeting Days/Times" + itemData . longAnswerField ;
$item ( "#text260" ). text = "Cost of Playgroup" + itemData . shortanswerfield ;
$item ( "#text261" ). text = "Contact/URL" + itemData . email ;
}
});