Hey,
I'm using this code to filter the checkboxes within a filter:
jQuery("#filterIngredient").on("keyup", function() {
var value = jQuery(this).val().toLowerCase();
jQuery(".main-groupbox .form-check").filter(function() {
jQuery(this).toggle(jQuery(this).text().toLowerCase().indexOf(value) > -1)
});
});
Typing a string filters out the unnecessary filters.
But when I press a filter checkbox, the value of my custom text input resets. Somehow that feels not right. Is this normal behavior? If so - is there a way to keep the custom text input value after the toolset filter custom search is triggered?
You can see here - hidden link - but you'll need to use hebrew letters to filter.
Hello. Thank you for contacting the Toolset support.
What you mean by the relationship "And" and "OR".
I'm on the following page and I used the characters you asked to use for search as search keyword "אספרסו" - when I add this keyword to search textbox - it shows me three results.
=> hidden link
Can you please clarify where exactly you want to apply "OR" with what result set?
Hey Minesh.
I made a more simplified view for you here:
hidden link
the text filter has nothing to do with toolset, it's a plain text input with jquery filtering function. but you will see that once you check a checkbox below - it resets the text input, if you put anything in it.
In your case, I see you added a text box that allow you to filter results using your custom JS code you added. Views AJAX search do not have any control on what you search using any specific keyword that gives you results using custom JS code.
Basically,this is expected and to integrate your custom JS code with Toolset AJAX request, you will require custom programming which is beyond the scope of our support policy.
Maybe you can check the following AJAX hooks that may help you to trigger the JS for your ajax events:
=> hidden link
If you will require more help with your custom JS code - you can always contact any of our certified partners listed with the following link:
=> https://toolset.com/contractors/
Hey Minesh,
The only thing I expect is the page not to reset when I click a checkbox...
Can this not happen? Does checking a checkbox have to refresh the page (including the search input)?
thx
I understand what you are saying. You should move the search textbox you have added outside the view's search form.
That is within "Search and Pagination" section, move your search text box before the [wpv-filter-start hide="false"] shorcode. Then it should not be get refreshed I believe.
Or
You can even try to move your input search textbox inside"Output Editor" section before "[wpv-filter-meta-html]" shorcode. If none of the above things helps, you may need to use one of the JS even hook I shared with my previous reply.