18910140161

如何将数据从HTML表单发送到Google Apps脚本堆栈溢出

顺晟科技

2022-10-19 11:38:46

75

我对google script和HTML非常陌生,我试图创建一个程序,该程序使用HTML表单接受用户的多个输入,当用户单击submit时,数据存储在变量中,并可以在.HTML的.gs文件中使用。我已经得到了工作表单,但每当我点击“提交”,什么也没有发生。经过一些故障排除,我认为问题出在我的form_data()函数上。我想知道的是如何编译来自表单的数据输入并将其发送到我的runsies()fucntion。提前感谢!下面是我的HTML代码:

const ui = SpreadsheetApp.getUi();

function onOpen() {
  ui.createAddonMenu()
      .addItem('New Entry', 'newEntry')
      .addToUi();
};

function newEntry() {
   var html = HtmlService.createHtmlOutputFromFile("input")
    .setWidth(750)
    .setHeight(550);
  
  //Display the dialog
  var dialog = ui.showModalDialog(html, "External Organisations");
};

function runsies(info){
  //Display the values submitted from the dialog box in the Logger.
  Logger.log(info);
};
const ui = SpreadsheetApp.getUi();

function onOpen() {
  ui.createAddonMenu()
      .addItem('New Entry', 'newEntry')
      .addToUi();
};

function newEntry() {
   var html = HtmlService.createHtmlOutputFromFile("input")
    .setWidth(750)
    .setHeight(550);
  
  //Display the dialog
  var dialog = ui.showModalDialog(html, "External Organisations");
};

function runsies(info){
  //Display the values submitted from the dialog box in the Logger.
  Logger.log(info);
};

顺晟科技:

数组只是一组元素ID,如果需要数据,请对文本框使用`document.getElementById().value

阅读有关客户端到服务器通信的信息google.script.run

JavaScript引用

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航