在 Formspree 中使用 _next 选项 [英] Making the _next option work in Formspree

查看:24
本文介绍了在 Formspree 中使用 _next 选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为位于

但是,通过线

我试图将此确认页面默认为 www.peek.solutions/confirmation.html.据我所知,这一行遵循 https://formspree.io/ 上的文档.谁能告诉为什么这不起作用?

解决方案

更新您的 URL 以包含 http: 将解决该问题.所以对于 _next 值应该是 http://peek.solutions/confirmation.html,

为了防止暴露您的电子邮件,并使用现在在表单中使用您的电子邮件的旧方法,您可以注册一个 免费 Formspree 帐户并生成自定义端点.有关 旧表单的更多信息在这里找到.

I'm working on a contact form for a static website at www.peek.solutions. The contact form works, in that I'm (after confirmation of my e-mail address) able to receive e-mails at the given address. Here is the code used:

<form id="contactform" action="//formspree.io/kurt.peek@gmail.com" method="POST">
<div class="col-sm-7 slideanim">
  <div class="row">
    <div class="col-sm-6 form-group">
      <input class="form-control" id="name" name="name" placeholder="Name" type="text" required>
    </div>
    <div class="col-sm-6 form-group">
      <input class="form-control" id="email" name="_replyto" placeholder="Email" type="email" required>
    </div>
  </div>
  <textarea class="form-control" id="comments" name="message" placeholder="Message" rows="5"></textarea><br>
  <div class="row">
    <div class="col-sm-12 form-group">
      <button class="btn btn-default pull-right" type="submit">Send</button>
    </div>
  </div>
</div>
<input type="hidden" name="_next" value="//peek.solutions/confirmation.html" />
<input type="text" name="_gotcha" style="display:none" />   
</form>

The problem is that when I submit the form by pressing the "Submit" button, I'm redirected to Formspree's default confirmation page:

However, through the line

<input type="hidden" name="_next" value="//peek.solutions/confirmation.html" />

I was trying to make this confirmation page default to www.peek.solutions/confirmation.html. As far as I can tell, this line follows the documentation at https://formspree.io/. Can anyone tell why this is not working?

解决方案

Updating your URLs to include http: will fix the issue. so for the _next value it should be http://peek.solutions/confirmation.html,

To prevent exposing your email, and using the now legacy method of using your email in forms, you can sign up for a free Formspree account and generate a custom endpoint. More info on legacy forms can be found here.

这篇关于在 Formspree 中使用 _next 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆