Forums › Forums › Search & Filter Pro › Show results on same page + filters not working
Tagged: filters not working, same page results, V3
- This topic has 38 replies, 2 voices, and was last updated 6 years, 4 months ago by Anonymous.
-
Anonymous(Private) August 17, 2018 at 3:35 pm #185876
I think I started something here:
First I unchecked the Auto submit form option to use the
enter
keypress to trigger the next action.
Then I put anonkeypress
function on the header search field to make it copy its value to sidebar’s search field (which will be hidden) on enter keypress.The first thing I needed is here: the same value on both inputs. But some other things are not exactly on place. I just wannna know which triggers S&F use so I can dig into them to make things work.
Whenever I submit a search, S&F destroys and restores the search field input. Once I’m adding the
onkeypress
function through a js, the restored input overrides thesetAttribute
declaration. Is there a safer/definitive way to attach thisonkeypress
to the field?The other thing is: how S&F triggers the filters after a search? I think if I could figure this out, maybe I can head into a solution.
Cheers
Trevor(Private) August 17, 2018 at 4:36 pm #185890On each of the fields (inputs and selects). When one of these changes, our filter is monitoring this and sees the change, and triggers the auto count (if set to ON). You can copy from one form to the other, but often that won’t actually trigger the input to say ‘Hey, I have changed,’ so you have to do that (trigger the change event of the input copied to) after you copy the value over.
Trevor(Private) August 17, 2018 at 5:50 pm #185906Other than WP-DEBUG that can be set in the wp-config.php (and an associated setting as to where to output, a file and/or the screen), no.
I don’t know if Chrome has the tools you need. You can always add console.log(“message”) or whatever to your code and see the output in the browser console.
There is also an event sf:ajaxformfinish (and also sf:ajaxformstart) which trigger when the Auto Count happens on the form. You can use these like this:
<script>(function ( $ ) {
“use strict”;
$(document).on(“sf:ajaxformfinish”, “.searchandfilter”, function(){
console.log(“ajax form auto count update complete”);// any other js here
});
}(jQuery));</script -
AuthorPosts