Hi,
Thanks for taking time to read this. I am trying to create a search bar that can search either tutor name or course name. what I can think about is create an if, else statment to run different searching code. However the code doesn’t work. Can anyone help me with this problem thanks.
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixData from ‘wix-data’;
$w.onReady( function () {
//TODO: write your page related code here…
});
export function input2_keyPress(event) {
let SearchValue = $w(“#input2”).value;
if ($w(‘#dataset1’).setFilter(wixData.filter().contains(“courseName” ,SearchValue))){
}//.or(wixData.filter().contains('tutorFname', SearchValue1))
else if ($w(‘#dataset1’).setFilter(wixData.filter().contains(‘tutorFname’ ,SearchValue))){
}
}