首页 > 解决方案 > 将 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?

标签: javascripthtmlgoogle-apps-scriptgoogle-forms

解决方案


<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) 来检测何时单击提交按钮,您将被重新路由到“谢谢”页面。这不是你的意思吗?


推荐阅读