How can I prevent form submissions until previous onFormSubmit is finished.

I have written a form script that eliminates the chosen answer. This means it has to process a function onFormSubmit. While the script works, the end-user has to wait 30 seconds before they click resubmit or else the choice will not be eliminated.

Is there a way I can prevent submissions until the onFormSubmit function is completed?

Answer1:

I was able to accomplish this (thank you AdamL) using setAcceptingResponses(enabled).

function onFormSubmit(){ var af = FormApp.getActiveForm(); var defaultClosedFor = af.getCustomClosedFormMessage(); af.setCustomClosedFormMessage("The form is currently processing a submission, please refresh the page."); af.setAcceptingResponses(false); <put your script stuff here> af.setAcceptingResponses(true); af.setCustomClosedFormMessage(defaultClosedFor); }

人吐槽 人点赞

Recommend

Comment

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:How can I prevent form submissions until previous onFormSubmit is finished.