Have you encountered an error screen with the title "Unable to submit form"? It would look like this:
If so, this article should help you resolve the problem.
What happened?
If you're seeing this screen it means two things:
- Your request lacks the HTTP "referer" header containing the webpage URL from which the form was submitted.
- The form was set up with an
action
attribute pointing to a Formspree URL that contains an email address. For example:https://formspree.io/email@domain.com
.
When the form action
URL contains only an email for identification, Formspree needs additional information contained in the "referer" header to identify the form. These email-based URLs were the original way to integrate with Formspree. Today we've moved to using a form ID in the URL so we no longer rely on the "referer" header.
Suggested solution
As the form owner, if you are using an action attribute like https://formspree.io/email@domain.com
then we suggest these steps:
- Create a free account at https://formspree.io/register.
- Create a new form. You'll receive an
action
URL that contains a unique form id. - Use the new URL in place of your previous email-based URL.
This will allow your form to work on all browsers and across all pages of your website. In addition you'll no longer need to expose your email in the form HTML, a potential security issue.
If you would like to transfer your existing submissions over to your new form, please submit a request to our support team and we can take care of it for you.
Legacy solution
As the form owner, if you are unable to change the action
attribute of your form, try the following troubleshooting steps. Note, without changing your URL as described in the suggested solution above your form may not load in all browsers. (see below)
- You may encounter this error when testing locally by opening an HTML file directly in your browser. In this case its URL will start with
file:///
instead ofhttp://
orhttps://
. This will not work because browsers don't treat these pages as normal web resources. Specifically, they don't send the "referer" header. Try running a local web server to host your form page. If you're on Mac or Linux, you can launch a web server by typing the following command on your terminal application:python -m SimpleHTTPServer 8000
Then visit http://localhost:8000 on your browser.
If you're on Windows, try installing one of the following web servers: Web server for Chrome, thttpd or Quickshare. - If you've configured your form to submit to a url with the
http://
protocol, but your form is hosted on a page accessed via thehttps://
protocol, the "referer" header won't be sent. You'll need to update youraction
URL. In this case we recommend the suggested solution above. - If you're using the Brave browser, please be aware that Brave may block the "referer" header. This issue has been filed with the Brave team. We'd love your help bringing this to the Brave team's attention by upvoting it.