Forums › Forums › Search & Filter Pro › Clear search input only
- This topic has 11 replies, 2 voices, and was last updated 5 years, 2 months ago by Trevor.
-
Anonymous(Private) August 28, 2019 at 12:44 pm #219835
Hi
I’m using S&F Pro for category multi-select filters, together with a search box.
The reset button will reset all filters of the form.Can you please assist with a solution to clear/reset the search input only, leaving the categories filters as they are ?
Thanks.
DoronAnonymous(Private) August 28, 2019 at 3:25 pm #219865Thanks Trevor
I actually tried to do so, created a button with a click function for:
$('.sf-field-search input').attr('value','');
$(‘.sf-field-search input div’).remove();
But it didn’t work well with the ajax call.
The filters currently use ajax with auto-submit.
I also tried to include the function on ajax start, but no luck.Can you please be more specific about how can i combine this correctly with the ajax functionality ?
Thanks.
Anonymous(Private) August 28, 2019 at 4:47 pm #219897Thanks.
The issue is that for some reason it doesn’t work the first time, just after page refresh (the page loads as it should according to the url containing the filters and the search) then it works.
I did this:
$('.sf-field-search input').attr('value','').empty();
$(“#search-filter-form-37”).submit();
Why it only works after refresh ? do i need some kind of callback to execute the submit after the clear is done ?
Thanks.
Trevor(Private) August 28, 2019 at 5:36 pm #219903I had to check back a way to see what our plugin developer said when I last asked this question, and the way he reset the value was different, see here:
https://support.searchandfilter.com/forums/topic/how-to-style-the-search-data/page/3/#post-43980
-
AuthorPosts