How do I set filters to reset automatically on new search? I have a search and some filters on a drupal 7 site. If I search a term, for example &quot;stuff&quot;, and there are 30 results, I can click a checkbox filter (let's call it FilterA) on the side and narrow my results down. But now if I type &quot;things&quot; in the search bar and submit it, FilterA is still clicked when the results come up. I need for all the filters to be unchecked when I perform a new search. I've gone through I feel every setting in the view and all the search and filter settings and still nothing. Thank you for any help you can provide.
To fix this I created a new block and inserted this code:
&lt;script&gt;
    //unchecks all checkboxes
    function clearCheckBoxes(){
        var uncheck=document.getElementsByTagName('input');
                    for(var i=0;i&lt;uncheck.length;i++){
                        if(uncheck[i].type=='checkbox'){
                            uncheck[i].checked=false;
                        }
                    }
    }
    //this function makes sure that new searches aren't hindered by filters set for previous searches.
    jQuery(function(){
        if(typeof(Storage) !== &quot;undefined&quot;){
            //retrieve what's in search box and remove whitespace
            var currentsearch = document.getElementById(&quot;searchbar&quot;).value;
            currentsearch = currentsearch.trim();       
            
            //if search box has a value that differs from the session storage search value then filter checkboxes are unchecked and url is sanitized of categories
            if (currentsearch.length &gt; 0){
                if (sessionStorage.getItem(&quot;squery&quot;)) {
                    let oldsearch = sessionStorage.getItem(&quot;squery&quot;);
                    if(currentsearch !== oldsearch){
                        clearCheckBoxes();
                        location.pathname = 'simplepathname';   
                    }
                }
                // set session storage search value equal to current value
                sessionStorage.setItem(&quot;squery&quot;, currentsearch);
            }
        }
    });
&lt;/script&gt;