我在 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>
这是否是由于代码错误、GitHub 页面错误或 formspree 错误造成的?
最佳答案
你应该做的事情如下:
- 根据 formspree示例:
<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>
这里将您的电子邮件放在“http://formspree.io/YOUREMAILHERE”中/之后。如果你想改变 name="email"
至 name="_replyto"
这会将发件人电子邮件更改为可点击的链接。(阅读邮件时有帮助)
- 如果这也不起作用,它会显示“您必须使用服务器。Formspree 将无法在作为 HTML 页面浏览的页面中工作。”
然后在你的<head>
里面标签放置:
<meta name="referrer" content="origin">
希望它有用!!
祝一切顺利:)
关于html - 从 GitHub 页面提交 formspree.io 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35236643/