title: How can I ajax data from an HTML form with checkboxes into a Google spreadsheet?
body: <p>I'm trying to pull data from an HTML form into a Google Sheet by using AJAX. I've gotten it to work fine with all types of inputs EXCEPT checkboxes. I've gotten it to return the first value checked, but not all values checked. </p>
  
  <p>Relevant parts of the markup and script below. Entry numbers and form URL are correct.</p>
  
  <pre><code>&lt;input type="checkbox" class="cb1" value="Scholarship1"&gt;Scholarship 1&lt;br&gt;
  &lt;input type="checkbox" class="cb1" value="Scholarship2"&gt;Scholarship 2&lt;br&gt;
  &lt;input type="checkbox" class="cb1" value="Scholarship3"&gt;Scholarship 3
  
  &lt;script type="text/javascript"&gt;
          function postToGoogle() {
  
  
             var formData = {
                  "entry.1226541462": $('.cb1').val()
              };
  
              $.ajax({
                  url: "https://docs.google.com/forms/d/1SqNCVpcZJ4N3huh8SrkU_uWuHFEBb2nCQXgUz3stI/formResponse",
                  data: formData,
                  type: "POST",
                  dataType: "xml",
                  statusCode: {
                      0: function() {
                          window.location.replace("thanks.html");
                      },
                      200: function() {
                          window.location.replace("thanks.html");
                      }
                  }
              });
          }
  
          $(document).ready(function(){
              $('.form').submit(function() {
                  postToGoogle();
                  return false;
              });
          });
      &lt;/script&gt;
  </code></pre>