Hereby the code that I use to search a database (‘Hulp’) on postal code (‘postcode’).
How to add the OR function so that the user can search for postcal code OR name for example?
import wixData from ‘wix-data’;
$w.onReady(function () {
//TODO: import wixData from ‘wix-data’;
});
export function searchButton_onClick(event) {
wixData.query(‘Hulp’)
.contains(‘postcode’, $w(‘#textInput1’).value)
.find()
.then(res => {
$w(‘#resultsTable’).rows = res.items;
});
}