title: Returning cell value based on Radio selection
body: <p>The goal I am trying to achieve is to retrieve a cell value based on a form radio selection and update a text area. </p>
  
  <p>Process: User opens dialog box. They select a field office. Onclick runs the function check. After check runs google.script.run.withSuccessHandler(addSignatureLine).getSignatureLine(cellElement); is supposed to run and update the textarea with the Id 'AdditionalMessage' with the signature line retrieved from .getSignatureLine.</p>
  
  <p>Here are two functions of the html code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script&gt;
  function addSignatureLine(signatureLine){
    document.getElementById('AdditionalMessage').value = '\n\n'signatureLine;
  };
  
  function updateSignatureLine() {
   var cellElement = document.getElementById('ET');
    console.log('cellElement: ' + cellElement);
  
    google.script.run.withSuccessHandler(addSignatureLine)
      .getSignatureLine(cellElement);
  };
  
  function check() {
    var ele = document.getElementsByName('fieldOfficeET');
    var flag = 0;
    
    for (var i = 0; i &lt; ele.length; i++) {
      if (ele[i].checked)
        flag = 1;
  
    }
    if (flag == 1)
      document.getElementById('Submit').disabled = false;
  
  };
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is the getSignatureLine.gs script</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getSignatureLine(cellObject) {
    var ss = SpreadsheetApp.openById('googleSheetId');
    var sheet = ss.getSheetByName('AMS Contact Information');
    var firstRow = 2;
    var lastRow = 10;
    var dataRange = sheet.getRange(firstRow, 1, lastRow, 11);
    var dataValues = dataRange.getValues();
  
    for (var key in cellObject) { //Loop through all the data in the form
      Logger.log('key: ' + key);
      Logger.log('value: ' + cellObject[key]);
    }
  
    //Determines the row the Field Office is in
    for (var rr = 0; rr &lt; dataValues.length; rr++) {
      if (dataValues[rr][0] == cellObject.fieldOfficeET) {
        var r = rr + 2
        break;
      }
    }
  
    var signatureLine = sheet.getRange(r, 11).getValue();
    Logger.log("signatureLine: " + signatureLine)
    return signatureLine;
  }</code></pre>
  </div>
  </div>
  </p>