title: Getting information submitted in form created by HtmlService
body: <p>I looked at similar questions concerning this topic but still unable to fully understand how to obtain data entered in a form created by HTML.</p>
  
  <p>Here is what I wanted to do:</p>
  
  <ul>
  <li>Create a form (via HTML)</li>
  <li>On form submission, data entered is used them to replace the appropriate placeholder keys
  in an existing Google Document Template.</li>
  <li>email the new Document with replaced text to the user.</li>
  </ul>
  
  <p>I follow this <a href="http://tjhouston.com/2012/03/merge-info-from-google-forms-to-pdf-document-and-send-via-email/" rel="nofollow">tutorial</a> and was able to get it work. The problem is the UI (Spreadsheet form) is not what I wanted. I want a form in HTML but unable to pull data correctly from it.</p>
  
  <p>Here is a sample script I created using Spreadsheet Form.</p>
  
  <pre><code>var docTemplate = "1234567890";  // Template ID
  var docName     = "FinalDocument";   // Name of the document to be created
  
  // When form gets submitted
  function onFormSubmit(e) { 
  // Get information from form and set as variables
    var email_address = e.values[1]; 
    var full_name = e.values[2];
  
  // Get document template, copy it and save the new document's id
    var copyId = DocsList.getFileById(docTemplate)
                 .makeCopy(docName+' for '+full_name)
                 .getId();
  // Open the temporary document
    var copyDoc = DocumentApp.openById(copyId);
  // Get the document's body section
    var copyBody = copyDoc.getActiveSection();
  
  // Replace place holder keys,in our google doc template
    copyBody.replaceText('keyEmailAddress', email_address);
    copyBody.replaceText('keyFullName', full_name);
  
  // Save and close the temporary document
     copyDoc.saveAndClose();
  
  // Convert temporary document to PDF by using the getAs blob conversion
     var pdf = DocsList.getFileById(copyId).getAs("application/pdf"); 
  
  // Attach PDF and send the email
     var subject = "Final Document";
     var body    = "Here is the form for " + full_name + "";
     MailApp.sendEmail(email_address, subject, body, {htmlBody: body, attachments: pdf}); 
  
  // Delete temporary file
     DocsList.getFileById(copyId).setTrashed(true);
  }
  </code></pre>
  
  <p>And here is the new form using HTML I just created.</p>
  
  <pre><code>&lt;html&gt;
    &lt;form id="myForm"&gt;
     &lt;input name="fullName" id="_fullName"&gt;
     &lt;input name="emailAddress" id="emailAddress"&gt;
     &lt;input type="button" id="submit" value="submit" onclick = "sendData()"&gt;
    &lt;/form&gt;
  
    &lt;script&gt;
      function sendData() {
       google.script.run.processForm(document.getElementById("myForm"));
      }
    &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Could someone help me get started on how to transition from using Spreadsheet form to HTML form? How do I pull data from the HTML form?</p>