问题
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