title: How can I pass a forms checked checkboxes to a PHP page as an array using a jQuery submit function?
body: <p>I have a  that has a list of checkboxes and user can click any number then click submit. The list of checkboxes is generated based on the results of a mySQL query - </p>
  
  <pre><code>echo("&lt;form id=\"target\" action = \"#\"&gt;");
  echo("&lt;ul&gt;");
  while($row = mysql_fetch_array($result) {
    $the_value = $row['result_value'];
    $the_label = $row['result_label'];
    echo("&lt;li&gt;&lt;input type='checkbox' name=\"ids[]\" value='" . $the_value . "'/&gt; " . $the_label . "&lt;/li&gt;\n");
  echo("&lt;/ul&gt;");
  echo("&lt;input type=\"submit\" value =\"Copy\"&gt;");
  echo("&lt;/form&gt;");
  </code></pre>
  
  <p>Then I have a jQuery handler for the submit</p>
  
  <pre><code>$('#target').submit(function() {
    alert(this.ids); // *See note below
    // I now want to call a PHP page, passing the array of ids so that this array can be used in a mySQL statement, then when complete notify the user it has succeeded
    return false;
  });
  </code></pre>
  
  <blockquote>
    <p>*If I give the checkbox group the name <b>ids</b> (name=\"ids\") rather than <b>ids[]</b> then this alert
    shows "[object NodeList]"</p>
  </blockquote>
  
  <p>How should I handle this?
  many thanks</p>