Forums › Forums › Search & Filter Pro › Secondary Submit ‘Search All’ Button
Tagged: Search All, Secondary Submit
- This topic has 11 replies, 5 voices, and was last updated 1 year, 9 months ago by Trevor.
-
Anonymous(Private) October 23, 2020 at 2:24 pm #263855
Hi Trevor,
We would like to add a secondary search button which can filter results based on a predefined condition (Show all) in our current requirement.
We currently have 4 search parameters (taxonomy dropdowns and text input search ) that works normally on submit button
We would also like to apply a different class name on the secondary button
Current:
Trevor(Private) October 23, 2020 at 3:37 pm #263873The only way I can think of doing this is to place a button (in the theme) after the form so that, that, when clicked, it runs JavaScript to modify the form filter values, and then submit the form. The latter can be done with:
$('.searchandfilter').submit();
Anonymous(Private) October 27, 2020 at 3:44 pm #264275Hi Trevor,
I have been able to setup a button as you suggested that perfectly works and triggers the search (AJAX) action but, I haven’t been able to send any custom value across to the results template that I can use while refreshing the results. Could you share any working example or guide with me as to how I can do this. What I am trying to pass on in AJAX request is a flag value that when passed, all filters should be cleared/ignored.
Ross Moderator(Private) October 30, 2020 at 4:04 pm #264784Hi Chuck
Just taking a look now… Where can I see second button the button you’ve wired up?
Do you just want it to clear the search form and reset the results (via ajax)?
Thanks
Anonymous(Private) February 14, 2023 at 7:16 pm #276749Is there a way you can provide the solution for this request? I’m trying to do a similar effect but rather than having a button that clears all the fields, I would like to do that individually.
I have two dropdowns. One for beds and one for baths (home builder site I’m working on). I would like to have a clear button on each dropdown which reverts back to the default value which corresponds to the “All items” filter.
-
AuthorPosts