title: jQuery serialize how to eliminate empty fields
body: <p>In this form users can add some info for Authors (music, lyric authors)</p>
  
  <p>The users have the option to add 1 or more authors.</p>
  
  <p>The problem is that when the user enters only 1 author all the other inputs remain empty, but the jQuery serialize function will put them anyway in the URL and the server gives me this error:</p>
  
  <pre><code>Request-URI Too Large
  </code></pre>
  
  <p>See the below example:</p>
  
  <pre><code>echo "&lt;form action=\"\" id=\"submForm\" name=\"submForm\" method=\"get\"&gt;";
  // AUTHOR NUMBER 1
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_name'))." &lt;/span&gt;&lt;input id=\"nameAuthor\" name=\"author[0][name]\" value=\"\" type=\"text\" class=\"commonInput\"&gt;&lt;/p&gt;"; 
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_DOB'))." &lt;/span&gt;&lt;input id=\"DOBAuthor\" name=\"author[0][DOB]\" value=\"\" type=\"text\" class=\"littleInput\"&gt;&lt;/p&gt;"; 
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_DOD'))." &lt;/span&gt;&lt;input id=\"DODAuthor\" name=\"author[0][DOD]\" value=\"\" type=\"text\" class=\"littleInput\"&gt;&lt;/p&gt;"; 
  // AUTHOR NUMBER 2
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_name'))." &lt;/span&gt;&lt;input id=\"nameAuthor\" name=\"author[1][name]\" value=\"\" type=\"text\" class=\"commonInput\"&gt;&lt;/p&gt;";
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_DOB'))." &lt;/span&gt;&lt;input id=\"DOBAuthor\" name=\"author[1][DOB]\" value=\"\" type=\"text\" class=\"littleInput\"&gt;&lt;/p&gt;"; 
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_DOD'))." &lt;/span&gt;&lt;input id=\"DODAuthor\" name=\"author[1][DOD]\" value=\"\" type=\"text\" class=\"littleInput\"&gt;&lt;/p&gt;"; Death:
  // AUTHOR NUMBER 3
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_name'))." &lt;/span&gt;&lt;input id=\"nameAuthor\" name=\"author[2][name]\" value=\"\" type=\"text\" class=\"commonInput\"&gt;&lt;/p&gt;"; 
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_DOB'))." &lt;/span&gt;&lt;input id=\"DOBAuthor\" name=\"author[2][DOB]\" value=\"\" type=\"text\" class=\"littleInput\"&gt;&lt;/p&gt;"; 
  echo "&lt;p&gt;&lt;span class=\"labelInput\"&gt;".(_t('_cR_DOD'))." &lt;/span&gt;&lt;input id=\"DODAuthor\" name=\"author[2][DOD]\" value=\"\" type=\"text\" class=\"littleInput\"&gt;&lt;/p&gt;"; 
  echo "&lt;/form&gt;"; 
  </code></pre>
  
  <p>And this is the jQuery code (it includes also a validate function, I am on jQuery 1.3.2)</p>
  
  <pre><code>echo "&lt;script type=\"text/javascript\"&gt;
  $(document).ready(function() {
   $('#submForm').validate({   
    submitHandler: function(form) {
    var serialized = $('#submForm').serialize()
    $.get('".$site['url']."modules/yobilab/copyright/classes/DO_submission.php', serialized);
      window.setTimeout('location.reload()', 8000);
  return false;
    form.submit();    
    } 
  })
  });
  </code></pre>
  
  <p>Now let's say the user will enter the fields ONLY for AUTHOR 1 and will leave AUTHOR 2 and AUTHOR 3 empty. How do I say to the jQuery serialize function to include in the URL ONLY the entered fields and to NOT include the empty fields at all?</p>