title: jquery serialize multiple checkboxes with same name
body: <p>I have searched and searched but cannot find answer to fit my exact situation. I am hoping someone can help.</p>
  
  <p>I am trying to "retrofit" a site using frames to use ajax and divs now. All is going well, except...</p>
  
  <p>This site has multiple forms. I am trying to write jquery code to handle all forms (using ajax of course). Therefore, using id selectors and the like is out. The real problem comes in when using <code>serialize()</code> to handle multiple checkboxes with same name.</p>
  
  <p>Consider the following scenario:</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form name="theform" method="post" action="form.cgi"&gt;
  &lt;input type="hidden" name="directory" value="test"&gt;
  &lt;input type="checkbox" name="file" value="file1.txt"&gt;
  &lt;input type="checkbox" name="file" value="file2.txt"&gt;
  ...
  &lt;input type="checkbox" name="file" value="file10.txt"&gt;
  &lt;input type="submit" name="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>jQuery</p>
  
  <pre><code>$(':submit').click(function(e){
  e.preventDefault();
  //Serialize form data from the parent form of the clicked submit button
  //This will enable handling of all forms across the site
  var formData=$(this.form).serialize();
  $.ajax({type: "POST", url: "form.cgi", data: formData, cache: false, 
  contentType: false, processData: false, success:function({alert(formData);}});
  });
  </code></pre>
  
  <p>This results in the alert showing only the <code>directory</code> field and corresponding value. None of the checkboxes (checked checkboxes, that is) are showing up in the data string.</p>
  
  <p>Why is <code>serialize()</code> not handling the checkboxes? I have read cases of cycling through the checkboxes, but I am not sure if this is possible. Also keep in mind that the processing script uses data in format of <code>name=value</code> so data fed in should look like <code>file=file1.txt&amp;file=file2.txt&amp;file=file3.txt</code>. </p>
  
  <p>Hope someone can help me with this...this one's got me befuddled.</p>