javascript - 将 Google 表单重定向到另一个 html 页面
问题描述
我已经将谷歌表单嵌入到这样的 HTML 表单中。表单被 subitted 并重定向到谷歌页面我想重定向到Here。我该怎么做?:
<form name="contact" action="https://docs.google.com/forms/u/0/d/e/1FAIpQLScG84LTIBt7p8dKjkg3uWCT2rgPDs1VGGNY1D58yEW5REiOFA/formResponse" id="popupForm" target="_self" method="post">
<input type="text" name="entry.79543200" placeholder="Cégnév/Név" class="w_100">
<input type="text" name="entry.94732913" placeholder="Telefonszám" class="w_100">
<div class="cleaner"></div>
<label id="" class="error" for="approxAmount"></label>
<div class="cleaner h20"></div>
<fieldset>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="radio" name="entry.1724649034" value="0-100 kg">
<span class="check"></span>
<span class="chkText">100 kg alatti hulladék</span>
</label>
</span>
</div>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="radio" name="entry.1724649034" value="100-500 kg">
<span class="check"></span>
<span class="chkText">100-500 kg</span>
</label>
</span>
</div>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="radio" name="entry.1724649034" value="500+ kg">
<span class="check"></span>
<span class="chkText">500+ kg</span>
</label>
</span>
</div>
</fieldset>
<div class="cleaner"></div>
<label id="" class="error" for="agree"></label>
<div class="cleaner"></div>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="checkbox" name="entry.959539170" value="agree" class="agree" id="agree" required>
<span class="check"></span>
</label>
</span>
<span class="chkText">Elfogadom az <a href="/files/adatvedelem.pdf" target="_blank" title="adatvédelmi nyilatkozat">adatvédelmi nyilatkozatot</a>.
</span>
</div>t
<div class="cleaner"></div>
<input type="submit" name="send3" id="submit-popup" value="Regisztráció" class="w_100 btn cta normal">
</form>
现在表单重定向到谷歌表单的提交页面,如图所示,提交数据后如何将其重定向到thankyou.html?
解决方案
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('#submit-popup').click(function(e) {
e.preventDefault();
window.location.href = "https://vitalhulladek.hu/thankyou.html";
});
});
</script>
<form name="contact" action="https://docs.google.com/forms/u/0/d/e/1FAIpQLScG84LTIBt7p8dKjkg3uWCT2rgPDs1VGGNY1D58yEW5REiOFA/formResponse" id="popupForm" target="_self" method="post">
<input type="text" name="entry.79543200" placeholder="Cégnév/Név" class="w_100">
<input type="text" name="entry.94732913" placeholder="Telefonszám" class="w_100">
<div class="cleaner"></div>
<label id="" class="error" for="approxAmount"></label>
<div class="cleaner h20"></div>
<fieldset>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="radio" name="entry.1724649034" value="0-100 kg">
<span class="check"></span>
<span class="chkText">100 kg alatti hulladék</span>
</label>
</span>
</div>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="radio" name="entry.1724649034" value="100-500 kg">
<span class="check"></span>
<span class="chkText">100-500 kg</span>
</label>
</span>
</div>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="radio" name="entry.1724649034" value="500+ kg">
<span class="check"></span>
<span class="chkText">500+ kg</span>
</label>
</span>
</div>
</fieldset>
<div class="cleaner"></div>
<label id="" class="error" for="agree"></label>
<div class="cleaner"></div>
<div class="checkContainer">
<span class="chkForm">
<label class="custom-form">
<input type="checkbox" name="entry.959539170" value="agree" class="agree" id="agree" required>
<span class="check"></span>
</label>
</span>
<span class="chkText">Elfogadom az <a href="/files/adatvedelem.pdf" target="_blank" title="adatvédelmi nyilatkozat">adatvédelmi nyilatkozatot</a>.
</span>
</div>t
<div class="cleaner"></div>
<input type="submit" name="send3" id="submit-popup" value="Regisztráció" class="w_100 btn cta normal">
</form>
基本上,您将使用 javascript (jquery) 来检测何时单击提交按钮,您将被重新路由到“谢谢”页面。这不是你的意思吗?
推荐阅读
- text - 如何更改乳胶中 \namesection 的字体大小?
- r - R data.table 逐行操作的首选性能过程?
- arduino - Ethernet.begin() preventin lcd.print() with 16x2 display
- python - 如何使用 Python 签署请求?
- android-studio - “在终端中打开”或“在磁盘上显示”不起作用
- r - 将二进制转换为列表
- powershell - 如何在控制台中转录所有内容
- bootstrap-table - 如何使用 jQuery 在引导表 api 自定义按钮中添加点击事件
- javascript - 添加自定义标题 react-infinite-calendar
- kubernetes - K8S HPA - 无法从外部指标 API 获取指标