Add a contact form to a Framer site
There are two ways to send a Framer form to FormKeep: paste an HTML form into an Embed component, or point Framer's own form at FormKeep as a webhook. The Embed route works on any FormKeep plan with no settings.
What you need
- A Framer site.
- A FormKeep form. Create one free; its URL is on the form's Setup tab and looks like
https://formkeep.com/f/YOUR-TOKEN.
Steps with an Embed component
- Create a form in FormKeep and copy its URL from the Setup tab.
- In Framer, open the Insert menu, search for Embed and drag the Embed component onto the canvas.
- In the component's HTML section, paste the form below with your URL as the
action.
- Publish the site, send a test message from the published page and open the form in FormKeep to see it.
The form
<form action="https://formkeep.com/f/YOUR-TOKEN" method="POST">
<input name="email" type="email" placeholder="Email" required>
<textarea name="message" placeholder="Message" required></textarea>
<button type="submit">Send</button>
</form>
What happens on submit
The browser posts the form and is redirected: to the redirect URL set in the form's Redirects tab in FormKeep ("Redirect to your site"), or to FormKeep's own thank-you page if none is set. A plain form post gets no JSON.
Or use Framer's own form with a webhook
Framer's form component can send each submission to a webhook as an HTTP POST with a JSON body. FormKeep stores the JSON fields like form fields, but Framer expects a 2xx answer and does not follow redirects, and FormKeep answers a post that does not ask for JSON with a redirect. So the form must be set to always answer with JSON first:
- In FormKeep, open the form's Redirects tab and choose "Force JSON response". The form then always answers
200 with null. This option is only offered on plans that include Redirects.
- In Framer, select the form on the canvas, click "Add..." next to "Send To" and choose "Webhook".
- Enter your FormKeep URL, which must start with
https://. The JSON keys are the names of Framer's form inputs.
- Publish, send a test and check the form in FormKeep.
Add file uploads
With the Embed route, add a file field and enctype="multipart/form-data" to the form. Each file can be up to 10 MB, and whether attachments are kept depends on your plan. The webhook route sends JSON and cannot carry files.
Troubleshooting
- 404 Not Found. The token in the URL is not a form. Copy the URL again from the form's Setup tab; do not type or guess it.
- 403 with
{"error":"This form is not accepting submissions."}. The form has been switched off. Switch it back on, or use another form.
- The webhook fails and Framer retries. The form is not set to "Force JSON response", so FormKeep answers with a redirect, which Framer does not follow. Each retry can store the submission again. Turn the option on, or use the Embed route.
- The embedded form does not appear in the editor. Publish and view the live page; Framer runs embedded code on the published site.
- A CORS error in the console. FormKeep answers requests from any origin, so you do not need a proxy, a server route or a CORS setting. Open the browser's network tab and read the status of the request: a 404 or 403 is the cause, not CORS.