WordPress Search & Filter Autosubmit

I’m working with the WordPress Search & Filter plugin and it’s exactly what I needed for filtering though my gallery and shop content! I would like to make my selections submit every time a dropdown is changed, as opposed to having to click the submit button. (See link below).

In researching other posts, I’ve found that the solution is to implement this into my theme’s java script file:

Read More
$(".searchandfilter select").change(function() {
$(".searchandfilter").submit();
});

I have put the line into my WooThemes Canvas’s ‘general.js’ file but it seems to make no difference. I still need to click on the submit button to make changes. I’ve tried placing it in various other js files but I’ve had no luck. The page in questions is this one:

http://richardrosenman.com/wordpress/portfolio/

Does anyone have any insight as to what I’m doing wrong? I would REALLY appreciate any help as I’m stuck (and somewhat of a novice with Javascript!).

Thanks!

Related posts

Leave a Reply

1 comment

  1. jQuery is loaded with jQuery.noConflict(); therefore you cannot use $ as selector (other libraries may be using it), instead use jQuery as selector:

    jQuery(document).ready(function(){
        jQuery(".searchandfilter select").change(function() {
            jQuery(".searchandfilter").submit();
        });
    });
    

    I think you can add it to general.js end of file since I see that file is loaded.