Remove empty url argument from view with exposed filter I have a view with exposed filter "Has taxonomy term" (filter identifier: "topic") and exposed sort: Created (default one) and Rating.
On a view page, when I change sort option to Rating, url of a view page is becoming
?topic=&amp;sort_by=rating

How to remove this empty argument from page url?

I tried

  $('#views-exposed-form-taxonomy-term-page').find(':input[value=""]').attr('disabled', true);


and

  $('#views-exposed-form-taxonomy-term-page').submit(function() {
    $(':input', this).each(function() {
        this.disabled = !($(this).val());
    });
  });


but it didn't work.
solved the problem:

(function ($) {
  Drupal.behaviors.citatyTaxonomy = {
    attach: function(context) {

      // disable blank input fields
      function disableEmptyInput() {
        $('#views-exposed-form-taxonomy-term-page').find(':input[value=""]').attr('disabled', true);
      }

      // on form submit
      $('#views-exposed-form-taxonomy-term-page').find('.views-submit-button input[type=submit]').click(function(){
        disableEmptyInput();
      });

      // view with auto-submit
      $('#views-exposed-form-taxonomy-term-page').find('.ctools-auto-submit-click').click(function(){
        disableEmptyInput();
      });

    }
  };
})(jQuery);