I am hosting a website on GitHub pages, and when I try to submit a formspree.io form I get the following error:
Here is my code:
<form action="http://formspree.io/[email protected]" 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>
Would this be due to a code error, GitHub pages error, or a formspree error?
GitHub pages allow you to host a website directly from your GitHub repository. It can host static websites that take HTML, CSS, and JavaScript files straight from your GitHub repository. It cannot execute server-side code like PHP so we can not add a contact form that redirects to a PHP file. That is where formspree comes in.
By default, after submitting a form the user is shown the Formspree "Thank You" page. You can provide an alternative URL for that page. This value is used for the email's subject, so that you can quickly reply to submissions without having to edit the subject line each time. This value is used for the email's CC Field.
1) In formspree click the sign-up button in the top right corner and enter your email address along with a password. 3) Press the + button and enter a form name. The email input box should be auto filled with the email address used to sign up to fromspree. 4) You can then copy paste the code provided by formspree into your website.
By default, your GitHub Pages site is built and deployed with a GitHub Actions workflow run unless you've configured your GitHub Pages site to use a different CI tool. To find potential build errors, you can check the workflow run for your GitHub Pages site by reviewing your repository's workflow runs.
<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>
Here put your email in "http://formspree.io/YOUREMAILHERE" after /. And if you want change name="email"
to name="_replyto"
this will change the senders email to a clickable link.(Helps while reading in mail)
Then inside your <head>
tag put:
<meta name="referrer" content="origin">
Hope it works!!
All the best :)
I had the exact same problem - add the following to your field:
<meta name="referrer" content="origin" />
This worked from me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With