谷歌表html不调用脚本功能
Google sheet html not calling script function
我有以下html代码在我的谷歌应用程序。它应该调用下面的函数,但我什么也没得到。到目前为止,我在所有代码中都使用了相同的脚本
<div id= "right_column">
<p>
<input type="button" value="Enter Grades for Selected Lessons"
onclick="google.script.run.withSuccessHandler(showMsgForLoginAttempt).generate_grades_for_lesson(this.parentNode)"/>
</p>
</div>
下面是函数
的代码function generate_grades_for_lesson(formObject) {
msgBox("Hello");
}
感谢您的帮助
在form元素周围使用form而不是p。使用type="text"代替value
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<div id= "right_column">
<form>
<input type="text" name="grades" placeholder="Grades...">
<input type="button" value="Enter Grades for Selected Lessons"
onclick="google.script.run.withSuccessHandler(showMsgForLoginAttempt).generate_grades_for_lesson(this.parentNode)"/>
</form>
</div>
</body>
</html>
<script>
function showMsgForLoginAttempt() {
console.log("success");
}
</script>
使用浏览器。Msgbox在Google apps脚本
function generate_grades_for_lesson(formObject) {
Browser.msgBox("Grades: " + formObject.grades);
}
相关文章:
- 如何使用Java脚本创建提交按钮's的拖放功能
- 如何将脚本的不同功能放在同一个html页面中
- 如何创建一个脚本,该脚本给定网站列表,它使用其搜索功能来获取信息
- 谷歌应用程序脚本搜索UI下一个和上一个功能
- 从用户脚本空间重新定义Firefox中的原生浏览器功能
- 加速谷歌脚本中的onEdit功能-有时没有响应
- 我想构建一个代码,在谷歌应用程序脚本中检查我在Gmail中导入的邮件,我该如何找到这个功能
- 功能中断 iPhone 的脚本(新手)
- jQuery脚本的功能相互重叠
- 在项目中使用谷歌应用程序脚本功能
- 仅当放置在HTML中时才具有简单的脚本功能
- 在React中使用外部脚本功能
- 脚本功能在Chrome中运行一次,但在Firefox中工作良好
- 引号需要在谷歌脚本功能参数
- 在“粘贴”后运行脚本功能
- 谷歌表html不调用脚本功能
- jQuery脚本功能似乎没有被加载
- 如何显示加载图像(GIF),直到脚本功能完成
- Java脚本功能在Chrome中突然停止工作
- 需要Java脚本功能,验证SQL查询,它不应该允许DML如alter,update,delete