title: How to prevent submitting the HTML form's input field value if it empty
body: <p>I have HTML form with input fields. Some of inputs can be empty, i.e. the value is "".</p>
  
  <p><code>&lt;input name="commentary" value=""&gt;</code></p>
  
  <p>Just now, when <code>commentary</code> field is not set, it appears in submit url like: <code>&amp;commentary=</code></p>
  
  <p>How I can remove empty inputs from the submit url, so when the <code>commentary</code> input is empty it would not be passed at all.</p>
  
  <p>Thank you very much.</p>
  
  <h3>Update</h3>
  
  <p>Thanks to <strong>minitech</strong> answer, I could resolve it. JavaScript code is below:</p>
  
  <pre><code>$('#my-form-id').submit(function() {
    var commentary = $('#commentary').val(); 
    if (commentary === undefined || commentary === "") {
      $('#commentary').attr('name', 'empty_commentary');
    } else {
      $('#commentary').attr('name', 'commentary');        
    }
  });
  </code></pre>
  
  <p>The only reason I have prefixed field name with "empty_" is that IE passes empty name in URL anyway.</p>