onSubmit form validation

独自空忆成欢 提交于 2020-08-11 18:10:26

问题


I am working on Google Forms, I look into the available events and there are only two; open and 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.

Is this possible in Google Forms? Can I get an example?


回答1:


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




回答2:


I am doing a similar project and it is possible with the right phrasing of the questions. You can write a code to build the form and use the text validation function. You create the code for the text question and then add a validation item to it. This checks to make sure the user types what is necessary and will send an optional help text box if necessary (like when you put in a time answer that isn't formatted properly). For more information on what I'm referencing, look here:https://www.bazroberts.com/2017/11/04/apps-script-basics-15-form-validation/

Good luck



来源:https://stackoverflow.com/questions/39472877/onsubmit-form-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!