从GitHub页面提交formspree.io时出错

Cor*_*ter 6 html forms github

我在GitHub页面上托管一个网站,当我尝试提交formspree.io表单时,我收到以下错误:

错误

这是我的代码:

<form action="http://formspree.io/example@example.com" method="post">
  <div class="row uniform collapse-at-2">
   <div class="6u">
    <input type="text" name="_replyto" placeholder="Email">
   </div>
  </div>
  <div class="12u">
   <textarea name="Message" placeholder="Message..." rows="4" cols="50" maxlength="500"></textarea>
  </div>
  <br>
  <div style="display:none">
   <input type="hidden" name="_subject" value="New submission!">
   <input type="hidden" name="_next" value="thanks.html">
   <input type="text" name="_gotcha">
  </div>
  <div class="row uniform">
   <div class="12u">
    <ul class="actions">
     <li>
      <input type="submit" class="special" value="Send">
     </li>
    </ul>
   </div>
  </div>
 </form>
Run Code Online (Sandbox Code Playgroud)

这是由于代码错误,GitHub页面错误还是formspree错误?

小智 10

你应该做的事情如下:

<form method="POST" action="http://formspree.io/YOUREMAILHERE">
  <input type="email" name="email" placeholder="Your email">
  <br>
  <textarea name="message" placeholder="Your message"></textarea>
  <button type="submit">Send</button>
</form>
Run Code Online (Sandbox Code Playgroud)

在/后面将您的电子邮件放在" http://formspree.io/YOUREMAILHERE "中.如果您想要更改name="email",name="_replyto"则会将发件人的电子邮件更改为可点击的链接.(在阅读邮件时帮助)

  • 如果这也不起作用,它表明"你必须使用服务器.Formspree将无法在作为HTML页面浏览的页面中工作."

然后在你的<head>标签里面放:

<meta name="referrer" content="origin">

希望它有效!!

祝一切顺利 :)


小智 5

我遇到了完全相同的问题 - 将以下内容添加到您的字段中:

<meta name="referrer" content="origin" />
Run Code Online (Sandbox Code Playgroud)

这对我有用。