Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 如何在上一个onFormSubmit完成之前阻止表单提交。_Google Apps Script - Fatal编程技术网

Google apps script 如何在上一个onFormSubmit完成之前阻止表单提交。

Google apps script 如何在上一个onFormSubmit完成之前阻止表单提交。,google-apps-script,Google Apps Script,我已经写了一个表单脚本,消除了选择的答案。这意味着它必须在FormSubmit上处理一个函数。脚本工作时,最终用户必须等待30秒,然后单击“重新提交”,否则将不会取消选择 在onFormSubmit功能完成之前,是否有办法阻止提交?我可以使用SetAcceptIngressons(已启用)完成此操作(感谢AdamL) 函数onFormSubmit(){ var af=FormApp.getActiveForm(); var defaultClosedFor=af.getCustomClosedF

我已经写了一个表单脚本,消除了选择的答案。这意味着它必须在FormSubmit上处理一个函数。脚本工作时,最终用户必须等待30秒,然后单击“重新提交”,否则将不会取消选择


在onFormSubmit功能完成之前,是否有办法阻止提交?

我可以使用SetAcceptIngressons(已启用)完成此操作(感谢AdamL)

函数onFormSubmit(){ var af=FormApp.getActiveForm(); var defaultClosedFor=af.getCustomClosedFormMessage(); af.setCustomClosedFormMessage(“表单当前正在处理提交,请刷新页面”); af.setAcceptingResponses(假); af.setAcceptingResponses(真); af.setCustomClosedFormMessage(默认ClosedFor); }
是,它确实可以防止再次提交。非常感谢。
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);
}