提交Google表单后如何重定向网站?

问题描述 投票:0回答:1

我在没有iframe标记的网站上使用google表单,所以我找不到如何写“谢谢”并取消转到google表单的响应页面的方法。

这是html代码:

<form action="https://docs.google.com/forms/u/2/d/e/1FAIpQLSeBJHw1Q6YlwO_0s2OgMhuyQEj4PLvToM1N1G5BEYQRiZlCLQ/formResponse">
                <label for="">It's FREE</label>
                <input type="text" placeholder="Full Name" class="inputs" id="input1" name="entry.1045366435">
                <input type="email" placeholder="Email" class="inputs" id="input2" name="entry.1398681060">
                <textarea id="" cols="30" rows="10" placeholder="Message" name="entry.403219718"></textarea>
                <input type="submit" id="submit" value="Send">
            </form>

<script type="text/javascript" src="form.js"></script>

我需要在js文件中写些什么?非常感谢!

javascript html forms google-apps-script google-form
1个回答
0
投票

您可以检查表单是否已提交。以下代码用于jQuery。

$('form').submit(function() {
  alert(1); // example code
  // add your code here
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form action="https://docs.google.com/forms/u/2/d/e/1FAIpQLSeBJHw1Q6YlwO_0s2OgMhuyQEj4PLvToM1N1G5BEYQRiZlCLQ/formResponse">
  <label for="">It's FREE</label>
  <input type="text" placeholder="Full Name" class="inputs" id="input1" name="entry.1045366435">
  <input type="email" placeholder="Email" class="inputs" id="input2" name="entry.1398681060">
  <textarea id="" cols="30" rows="10" placeholder="Message" name="entry.403219718"></textarea>
  <input type="submit" id="submit" value="Send">
</form>
© www.soinside.com 2019 - 2024. All rights reserved.