title: Submit google form through angular without leaving page
body: <p>I'm taking the POST data from a form field and sending it to a Google Spreadsheet through Google Forms. I would like to submit the form so that it does not redirect to the submission page for Google Forms on completion.</p>
  
  <p><strong>Here is my form code:</strong></p>
  
  <pre><code>&lt;form ng-submit="bookingForm()"&gt;
      &lt;input class="input-field" type="datetime-local" id="schedule-date-input" name="entry.127627252" value="" ng-model="schedule.datestart"&gt;
      &lt;label class="input-label" for="schedule-date-input"&gt;
          &lt;span class="input-content"&gt;Start Date&lt;/span&gt;
      &lt;/label&gt;
  
       ... more inputs ...
  
      &lt;input type="submit" name="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>and here is my js:</strong></p>
  
  <pre><code>'$scope', '$http', function ($scope, $http) {
          $scope.bookingForm=function(){
              console.log($scope.schedule);
  
              $http({
                  method:'POST',
                  url: 'https://docs.google.com/forms/d/MY-FORM/formResponse',
                  data:$.param($scope.schedule),
                  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  
              }).success(function(response) {
                  alert('yes');
              }).error(function(response) {
                  alert('no');
              });
          };
  </code></pre>
  
  <p>On submission of the form, I get the following error:</p>
  
  <pre><code>XMLHttpRequest cannot load https://docs.google.com/forms/d/MY-FORM/formResponse.
  No 'Access-Control-Allow-Origin' header is present on the requested resource.
  Origin 'http://localhost' is therefore not allowed access.
  </code></pre>
  
  <p>How do I set up my form so that it will submit to the Google Forms url without leaving the page?</p>