title: onClick on Google Script not working for HTML Form
body: <p>I'm trying to create a html pop up that will then populate a gsheet. I've basically used the same solution found <a href="https://stackoverflow.com/questions/34325826/how-can-i-add-multiple-inputs-from-an-html-ui-to-a-google-spreadsheet">here</a>. For some strange reason though, it isn't working. When I click the submit button on the HTML pop up box after filling out all the data, it doesn't respond. I click, it doesn't close, append the data, or do anything. </p>
  
  <p>The html pop up is created, but the Submit button doesn't work. I am almost sure that it is has something to do with the onClick method I am using. </p>
  
  <p>Here is the code I am working with:</p>
  
  <h2>gs file</h2>
  
  <pre><code>function registerCustomer() {
    var html = HtmlService.createHtmlOutputFromFile('customerMenu.html').setSandboxMode(HtmlService.SandboxMode.IFRAME);
    SpreadsheetApp.getUi()
         .showModalDialog(html, 'Add Customer');
  }
  
  function customerAdd(customerForm) {
    var ss = SpreadsheetApp.getActiveSpreadsheet;
    var cus_db = ss.getSheetByName("customer_db");
  
    cus_db.appendRow(["  ", customerForm.name_1, customerForm.name_2, customerForm.phone, customerForm.age, customerForm.channel]);
    return true;
  }  
  </code></pre>
  
  <h2>html file</h2>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;base target="_top"&gt;
      &lt;link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css"&gt;
    &lt;/head&gt;
    &lt;br&gt;
    &lt;customerForm&gt;
      First Name:&lt;br&gt;
      &lt;input type="text" name="name_1"&gt;
      &lt;br&gt;
      Second Name:&lt;br&gt;
      &lt;input type="text" name="name_2"&gt;
      &lt;br&gt;
      Phone Number:&lt;br&gt;
      &lt;input type="text" name="phone"&gt;
      &lt;br&gt;
      Age:&lt;br&gt;
      &lt;input type="number" name="age"&gt;
      &lt;br&gt;
      How did they hear about us?:&lt;br&gt;
      &lt;input type="text" name="channel"&gt;
      &lt;br&gt;&lt;br&gt;
       &lt;input type="submit" value="Add Customer" class ="submit" 
             onclick="google.script.run
             .withSuccessHandler(google.script.host.close)
             .customerAdd(this.parentNode)" /&gt;
      &lt;/customerForm&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've scoured stackoverflow for almost every solution:</p>
  
  <ol>
  <li><p>I am running two pop ups so I changed the function names based on the advice <a href="https://stackoverflow.com/questions/49174206/use-itemadd-for-2-differents-form-in-2-differents-functions-google-script">here</a></p></li>
  <li><p>I tried to use the '''document.forms[0]''' method found <a href="https://stackoverflow.com/questions/16525553/get-value-of-html-text-box-in-apps-script-function">here</a> also didn't work </p></li>
  </ol>
  
  <p>What am I missing?</p>