Boc*_*oco 28 html google-forms
我正在寻找一个解决方案(代码)如何在用旧Google表单提交表单后将用户重定向到自定义的感谢页面(不是默认的Google).
<iframe name="hidden_iframe"
        id="hidden_iframe"
        style="display:none;"
        onload="if(submitted){window.location='http:/...yourthankyoupage.htm';}">
</iframe>
<form action="https://spreadsheets.google.com/formResponse?formkey=....."
      method="post"
      target="hidden_iframe"
      onsubmit="submitted=true;">
Run Code Online (Sandbox Code Playgroud)
此代码无效.至少不适合我.有什么建议?
小智 35
这是你自己设计的一种形式吗?这里有一些好的阅读:http://morning.am/tutorials/how-to-style-google-forms/
基本上它...替换
<form action="YOUR-EMBEDDED-GOOGLE-SPREADSHEET-LINK" method="POST">
Run Code Online (Sandbox Code Playgroud)
同
<script type="text/javascript">var submitted=false;</script>
    <iframe name="hidden_iframe" id="hidden_iframe" style="display:none;"     
onload="if(submitted) {window.location='whateveryourredirectis.html';}"></iframe>
      <form action="YOUR-EMBEDDED-GOOGLE-SPREADSHEET-LINK" method="post" target="hidden_iframe" 
onsubmit="submitted=true;">
Run Code Online (Sandbox Code Playgroud)
        Sneaky Sheep 版本 2可以自动生成必要的 html 以将表单嵌入您的网站。它保留了表单的样式表。
或者,如果您使用的是 Sneaky Sheep的原始版本,请确保在样式部分附加正确的域名以获取样式表。
例如,我不得不改变
<link href='/static/forms/client/css/1234-formview_ltr.css' type='text/css' rel='stylesheet'>
Run Code Online (Sandbox Code Playgroud)
到
<link href='https://docs.google.com/static/forms/client/css/3904611051-formview_ltr.css' type='text/css' rel='stylesheet'>
Run Code Online (Sandbox Code Playgroud)