title: Error 400 when submitting form but information is still received in google sheet
body: <p>I am receiving a error 400 when submitting a form, yet the data is transferred to my Google Sheet as intended.</p>
  
  <p>I've read up on what may cause a 400 error but my understanding is not advanced enough to spot the error in the code.</p>
  
  <p>code.gs</p>
  
  <pre><code>function doGet() {
    return HtmlService
        .createTemplateFromFile('jSignature')
        .evaluate();
  }
  
  function saveImage(bytes, sign){
    var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('FormResponse');
    var dateObj = Date.now();
    var bytes = bytes.split(",")
    var blob = Utilities.newBlob(Utilities.base64Decode(bytes[1]), 'image/png');
    var fileName = blob.setName("Signature "+dateObj).getName();
    var sigFolder = DriveApp.getFolderById("myFolder"); //replace with your folder id
    var url = sigFolder.createFile(blob).getId();
    Logger.log(url)
    var carrier = sign.carrier;
    var address = sign.address;
    var dname = sign.dname;
    var dnum = sign.dnum;
    var date = sign.date;
    var time = sign.time;
    var tractortruck = sign.tractortruck;
    var odom = sign.odom;
    var imageCell = ss.getRange(ss.getLastRow()+1, 1, 1, 9).setValues([[carrier, address, dname, dnum, date, time, tractortruck, odom, url]]);
  }
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;meta name="viewport" content="width=device-width, initial-scale=2, maximum-scale=1, user-scalable=0"/&gt;&lt;/head&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdn.rawgit.com/willowsystems/jSignature/master/libs/jSignature.min.js"&gt;&lt;/script&gt;
  &lt;style&gt;
  &lt;/style&gt;
  &lt;body&gt;
  &lt;center&gt;&lt;h1&gt;&lt;big&gt;&lt;big&gt;DRIVER VEHICLE INSPECTION REPORT&lt;/big&gt;&lt;/big&gt;&lt;/h1&gt;
  &lt;h5&gt;AS REQUIRED BY THE D.O.T. FEDERAL MOTOR CARRIER SAFETY REGULATIONS&lt;/h5&gt;&lt;/center&gt;&lt;br&gt;
  &lt;form id="customerForm" action="/action_page.php"&gt;
  &lt;div class="container"&gt;
    &lt;label for="carrier"&gt;Carrier:&lt;/label&gt;
      &lt;select id="carrier" name="carrier" required&gt;
        &lt;option value="My Company"&gt;My Company&lt;/option&gt;   
        &lt;/select&gt;&lt;br&gt;
      Location:
    &lt;table id= "Address"&gt;
    &lt;tr&gt;
    &lt;td&gt;PDX&lt;/td&gt;
    &lt;td&gt;EUG&lt;/td&gt;
    &lt;td&gt;SEA&lt;/td&gt;
    &lt;td&gt;SFO&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;&lt;input type="radio" id="PDX" oninput="this.className = '';EUG.className = '';SEA.className = '';SFO.className = ''" name="Address" value="PDX"&gt;&lt;/td&gt;
  
    &lt;td&gt;&lt;input type="radio" id="EUG" oninput="this.className = '';PDX.className = '';SEA.className = '';SFO.className = ''" name="Address" value="EUG"&gt;&lt;/td&gt;
  
    &lt;td&gt;&lt;input type="radio" id="SEA" oninput="this.className = '';EUG.className = '';PDX.className = '';SFO.className = ''" name="Address" value="SEA"&gt;&lt;/td&gt;
  
    &lt;td&gt;&lt;input type="radio" id="SFO" oninput="this.className = '';EUG.className = '';SEA.className = '';PDX.className = ''" name="Address" value="SFO"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
        &lt;label for="Driver name"&gt;Driver Performing Inspection:&lt;/label&gt;
    &lt;input type="text" id="dname" name="drivername" placeholder="Your full name" required&gt;&lt;br&gt;
    &lt;label for="Driver Employee ID number"&gt;Driver's Employee Number:&lt;/label&gt;&lt;br&gt;
    &lt;input type="number" id="dnum" name="drivernumber" placeholder="Your employee number" required&gt;&lt;br&gt;&lt;br&gt;
    &lt;label for="Date"&gt;Date Performed:&lt;/label&gt;&lt;br&gt;
    &lt;input type="date" id="date" name="date" required&gt;&lt;br&gt;&lt;br&gt;
    &lt;label for="Time"&gt;Time Performed:&lt;/label&gt;&lt;br&gt;
    &lt;input type="time" id="time" name="time" value="now" required&gt;&lt;br&gt;&lt;br&gt;
    &lt;label for="Tractor/Truck#"&gt;Tractor / Truck #:&lt;/label&gt;&lt;br&gt;
    &lt;input type="number" id="tractor/truck" name="tractortrucknum" placeholder="Your vehicle number" required&gt;&lt;br&gt;&lt;br&gt;
    &lt;label for="Odometer"&gt;Odometer Reading:&lt;/label&gt;&lt;br&gt;
    &lt;input type="number" id="odom" name="odometer" placeholder="Vehicle odometer reading" required&gt;&lt;br&gt;&lt;br&gt;
  &lt;b&gt;&lt;big&gt;Signature:&lt;/big&gt;&lt;/b&gt;
  &lt;div id="signature"&gt;&lt;/div&gt;&lt;br&gt;
  &lt;img id="rendered" src="" style="display:none"&gt;
  &lt;input type="submit" value="Submit and close" onclick="renderSignature();saveImage();"/&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;script&gt;
  
    $("#signature").jSignature({
      'background-color': 'transparent',
      'decor-color': 'transparent',
    });
  
    function renderSignature(){
      $("img#rendered").attr("src",$('#signature').jSignature('getData','default'));
    }
  
      function saveImage(e){ //This sends the image src to saveImages function
      var bytes = document.getElementById('rendered').src;
      console.log(bytes);
      var sign = {
        carrier: document.getElementsByName('carrier')[0].value,
        address: $('input[name="Address"]:checked').val(),
        dname: document.getElementsByName('drivername')[0].value,
        dnum: document.getElementsByName('drivernumber')[0].value,
        date: document.getElementsByName('date')[0].value,
        time: document.getElementsByName('time')[0].value,
        tractortruck: document.getElementsByName('tractortrucknum')[0].value,
        odom: document.getElementsByName('odometer')[0].value,
      };
      alert("saveImage successful");
      google.script.run.saveImage(bytes, sign);
      return
    }
  
  let date = new Date().toISOString().substr(0, 10);
  document.querySelector("#date").value = date;
  
  $(function(){     
    var d = new Date(),        
        h = d.getHours(),
        m = d.getMinutes();
    if(h &lt; 10) h = '0' + h; 
    if(m &lt; 10) m = '0' + m; 
    $('input[type="time"][value="now"]').each(function(){ 
      $(this).attr({'value': h + ':' + m});
    });
  });
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Ideally, I'd like to see the form take the user to a URL on submit.  I think I can figure this out once we resolve the 400 issue.  If anyone has advice, though, I'd love to hear it.</p>