title: Remove empty query strings from url
body: <p>I'm trying to remove empty parameters from the url querystring before form submission.</p>
  <p>form submission on a <code>GET</code> request:</p>
  <pre><code>&lt;input class=&quot;btn&quot; type=&quot;submit&quot; value=&quot;Search&quot;&gt;
  </code></pre>
  <p>I've come across this example</p>
  <pre><code>jQuery(document).ready(function ($) {
  
          // Remove empty fields from GET forms
  
          // Change 'form' to class or ID of your specific form
          $(&quot;form&quot;).submit(function () {
              $(this).find(&quot;:input&quot;).filter(function () { return !this.value; }).attr(&quot;disabled&quot;, true);
  
              return true; // ensure form still submits
          });
  
          // Un-disable form fields when page loads, in case they click back after submission
          $(&quot;form&quot;).find(&quot;:input&quot;).prop(&quot;disabled&quot;, false);
      });
  </code></pre>
  <p>The issue I have with this is that it disables the input fields instead of just ignoring the empty ones. I don't want to disable inputs but rather ignore empty ones.</p>
  <p>Is there a way I can achieve this? Any suggestions?</p>
  <p>Thank you.</p>