How can I enable auto submission on only one field?

Forums › Forums › Search & Filter Pro › How can I enable auto submission on only one field?

Tagged: ,

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #73286

    I intend to separate search and sort. Search fields on the left then sort on the far top right position. I have already managed to achieve this visually but now the problem is that having someone go back to click on the submit button after choosing the sort criteria is very bad user experience. How can I enable auto-submit on the sort field only?

    I tried having two forms one for search and one for only sorting, but the sort auto submission keeps resetting the search results.

    Trevor
    #73292

    This is not possible with the plugin as it is now. I could be suggested as a feature request though.

    However, you could switch off auto submit and instead add some custom javascript to trigger the form’s submit with the onchange event for the sort order.

    Anonymous
    #73348

    Thanks Trevor, custom javascript worked. You guys may want to consider offering a way to separate the two (Search and Sort) in future. It will offer more flexibility in terms of design. A typical search page has search fields positioned to the left and sort on the top right.

    Thanks again

    Anonymous
    #73350

    Posting the code here, it may help someone.

    jQuery(function () {
      jQuery(".YOURSORTSELECT").on("change keyup", function () {
        jQuery("#YOURFORMID").submit();
      });
    });
    Trevor
    #73360

    Great. Thanks for sharing.

Viewing 5 posts – 1 through 5 (of 5 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.