title: Oddity when passing checkbox data to db via jQuery post
body: <p>I'm encountering an odd issue.  I need to asynchronously post data to a 3rd party system.  Everything works fine except the two checkboxes at the end of my form.  Unfortunately, I don't have access to the system's db, so success/failure is simply determined if any results show up in the admin area of that system.</p>
  
  <p>The form and jQuery are constructed in PHP.  Relevant fields below:</p>
  
  <pre><code>Have a Representative Call Me: &lt;input  id="00N60000002Rtib" name="00N60000002Rtib" type="checkbox" value="1" /&gt;&lt;br&gt;
  Send Marketing Material and Updated News: &lt;input  id="00N60000002Rtig" name="00N60000002Rtig" type="checkbox" value="1" /&gt;&lt;br&gt;
  </code></pre>
  
  <p>The data construction (PHP):</p>
  
  <pre><code>foreach ($values as $key =&gt; $val) {
      if ($key == '00N60000002Rtib' || $key == '00N60000002Rtig') {
          $data .= "$key : $val, ";
      } else {
          $data .= "$key : \"$val\", ";
      }
  }
  
  $data = substr($data, 0, -2); // remove trailing comma and space
  </code></pre>
  
  <p>And jQuery construction:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(window).load(function() {
          $.post('http://somesite.com', { &lt;?php echo $data; ?&gt; });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Viewing HTML source confirms that my post $data is constructed properly.</p>
  
  <p>What's <strong>really</strong> strange is that a pure HTML form with the same fields posts properly.  I'm stumped.  Any ideas?</p>