Search box Problem...

Hello, I have a working filter buttons & search box on my site. But the problem is when I set a value in my search box.
Ex: Michel

But when you set a value within the search box I can’t use the filter buttons afterwords, is their a way to apply a reset value within the search box code, some like when click on a the filter buttons it reset’s the value within the search box?
The link to my website is here: wixcode-01

This is the code for the search box:

export function searchButton_onClick() {
	wixData.query('ApplicationForm')
		.contains('fullName', $w('#textInput1').value)
		.find()
		.then(res => {
			$w('#table1').rows = res.items;
		});
}

Hi,

in case of buttons you are setting filter to dataset in case of search you are executing direct Wix Data Query. That is the reason why it stops working.

You could stick to always using data set filters. So, for example search could become:

$w("#dataset1").setFilter(wixData.filter().contains('fullName', $w('#textInput1').value);

You could also, include search option with any other filter by appending contains clause to the other filters.

I hope this helps. Let me know if you need any further assistance.

So the code would look something like this?

export function searchButton_onClick() {
	$w("#dataset1").setFilter(wixData.filter().contains('fullName', $w('#textInput1').value);
}

Yes. Just one ‘)’ is missing. My bad.

export function searchButton_onClick() { 
    $w("#dataset1").setFilter(wixData.filter().contains('fullName', $w('#textInput1').value)); 
}

Thanks, it worked like a charm.