onSubmit表单验证 [英] onSubmit form validation
问题描述
我正在使用Google表单,研究可用的事件,只有两个; open
和onSubmit
I am working on Google Forms, I look into the available events and there are only two; open
and onSubmit
如果我的验证条件之一失败,并且我在应用脚本上为表单onSubmit
触发器指定了验证条件,则我想停止提交表单.
I want to stop form submission if one of my validation criteria fails that would be specified on my app script for the form onSubmit
trigger.
例如,我想获取一个字段的值并将其与电子表格中的值列表进行比较(如果在价差值列表中找到了表单中的值,则继续进行表单提交,否则提示用户)重新提交表格.
For example, I want to fetch the value of one of the fields and compare it to a list of values in a spread sheet if the value in the form is found in the spread value list then proceed to form submission otherwise prompt user to resubmit form.
在Google表单中可以这样做吗?我可以举个例子吗?
Is this possible in Google Forms? Can I get an example?
推荐答案
很抱歉有人这么说,但这是不可能的. Google Apps脚本与提交表单的用户之间没有任何可能的互动.如果您想要动态的东西,则需要使用HtmlService从A到Z开发一些东西,而无需使用Google Form
Sorry to be the one who say that, but it's not possible. there is no possible interaction between Google Apps Script and the user submitting the form. If you want something dynamic, you'll need to develop something from A to Z with HtmlService without using google Form
这篇关于onSubmit表单验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!