Google Sheets/Scripts:将回复(HTML 侧边栏)填入 sheet

Google Sheets/Scripts: Form responses (HTML sidebar) into sheet

我想做的就是让我的侧边栏处理用户条目并将它们输入到我的 sheet 中的指定范围内。到目前为止,这是我的代码:

function onOpen(e) {
  var html = HtmlService.createHtmlOutput()
      .setTitle('TITLE')
      .setContent('<label>Enter Search Term:  </label> <br /><input id="WCB#" name="WCB#" type="text" /><br /><label>Enter Start Date:  </label> <br /><input id="WCB#" name="WCB#" type="text" /><br /><label>Enter End Date:  </label> <br /><input id="WCB#" name="WCB#" type="text" /><br /><input type="button" value="Submit" google.script.run.withSuccessHandler(onSuccess) />');
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .showSidebar(html);

}

我倾向于这样做

function showMySideBar() 
{
  var s='Enter Search Term:';
  s+='<br /><input id="WCB#" name="WCB#" type="text" />';
  s+='<br />Enter Start Date:';
  s+='<br /><input id="WCB#" name="WCB#" type="text" />';
  s+='<br />Enter End Date:';
  s+='<br /><input id="WCB#" name="WCB#" type="text" />';
  s+='<br /><input type="button" value="Submit" onClick="google.script.run.withSuccessHandler(onSuccess).functionName();" />'
  var html = HtmlService.createHtmlOutput(s).setTitle('TITLE');
  SpreadsheetApp.getUi().showSidebar(html);
}