title: Add a Javascript array to POST variable on form submit
body: <p>I have a Javascript array that I would like to add to the post array when a form is submitted.  The Javascript array should be added in addition to other variables already being posted from the form.  Is there a way to do this in JQuery?</p>
  
  <p>Ex.</p>
  
  <p>Form:</p>
  
  <pre><code>&lt;form id="my-form" action="/create.php" method="post"&gt;
  &lt;input id="first_name" type="text" /&gt; 
  &lt;input id="last_name" type="text" /&gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p>Javascript array:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var external_ids = [{"name":"SSN","value":"555-55-5555"},    
  {"name":"PID","value":"GBNT22"}];
  
  &lt;/script&gt; 
  </code></pre>
  
  <p>This is what I would like the resulting PHP $_POST array to look like, if possible:</p>
  
  <pre><code>Array
  (
      [first_name] =&gt; John
      [last_name] =&gt; Smith
      [external_ids]=&gt;
          (
              [SSN] =&gt; 555-55-5555
              [PID] =&gt; GBNT22
          )
  )
  </code></pre>