Falkenstein, Germany · Hetzner Online GmbH
FormHaven

A contact form for a Lovable site, without a backend

Paste one prompt into Lovable and every message from your contact form reaches your inbox. No database table, no edge function and no API key in your app. Messages are stored in the EU, and spam is filtered out before it reaches you.

14 days free, no card. Paste the address where the code says YOUR_FORM_ID.

Prompt for Lovable
Make the contact form on this site work. Set its action to
https://formhaven.net/f/YOUR_FORM_ID with method POST, give every input a
name attribute, and add a hidden input named _gotcha that
people cannot see. Submit it with fetch, sending
new FormData(form) and the header Accept: application/json.
The reply is JSON: show a thank-you message when ok is true,
and show message when ok is false. Do not add a database
table or an edge function for this form.

Set it up

  1. 1

    Create a form in FormHaven

    Sign up, press New form and copy its address. It looks like https://formhaven.net/f/YOUR_FORM_ID. The form's Setup tab also has a shorter prompt with your address already in it.

  2. 2

    Paste the prompt into Lovable

    Lovable rewrites the form on your contact page to post to that address. Nothing is added to your backend.

  3. 3

    Publish

    Publish as usual, on your lovable.app address or your own domain. The form posts to FormHaven either way.

  4. 4

    Send a test

    Fill in the form on the published site and check your inbox. Or press Send a test submission in FormHaven.

What Lovable should end up with

If you would rather check the code, or write it yourself, this is the shape in React: a normal form, sent with fetch, showing the answer under the button. Without JavaScript it still posts the normal way.

ContactForm.tsx
import { useState, type FormEvent } from "react";

export function ContactForm() {
  const [status, setStatus] = useState("");

  async function send(event: FormEvent<HTMLFormElement>) {
    event.preventDefault();
    const form = event.currentTarget;
    const response = await fetch(form.action, {
      method: "POST",
      headers: { Accept: "application/json" },
      body: new FormData(form),
    });
    const { ok, message } = await response.json();
    setStatus(ok ? "Thanks, your message is on its way." : message);
    if (ok) form.reset();
  }

  return (
    <form action="https://formhaven.net/f/YOUR_FORM_ID" method="POST" onSubmit={send}>
      <input type="email" name="email" required />
      <textarea name="message" required />
      <input type="text" name="_gotcha" style={{ display: "none" }} tabIndex={-1} autoComplete="off" />
      <button type="submit">Send</button>
      <p role="status">{status}</p>
    </form>
  );
}

Stop bots that skip the hidden field

Turn on the bot check in the form's settings, then ask Lovable to add the script once. It finds forms React draws after the page loads, and new FormData(form) carries its answer. Visitors see nothing, and it sets no cookies.

Prompt for Lovable
Add this script tag once to the head of every page:
<script src="https://formhaven.net/bot-check.js" async></script>

Questions about this setup

Why not a Supabase table or Lovable Cloud?
You can, but then the email to you, the spam filtering and a place to read old messages are parts you build and keep running. Posting to FormHaven gives you all three, and keeps form data out of your app's database.
Does it work after I export the code to GitHub?
Yes. The form posts to FormHaven, not to Lovable, so it works wherever the site is hosted: lovable.app, your own domain, Netlify or Vercel.
Can my client get the messages instead of me?
Yes. Add up to 5 more addresses to the form. Each one confirms by a link first, and their copy carries no FormHaven branding. You can turn your own copy off.
Can Lovable create the form itself?
An agent with an API key can, through our MCP server or REST API: it creates the form, writes the address into your code and reads submissions back. In Lovable the prompt above is the simpler route.
Where is the data stored?
On our servers in the EU, for 1 to 365 days as you choose per form, or not at all: then each message is emailed and its answers deleted. A data processing agreement covers every account.

More to read

Astro contact formA Contact.astro component for a static Astro site HTML form to emailOne line in the action, every message in your inbox Static site contact formOne form for Astro, Hugo, Eleventy, Jekyll or plain HTML Hugo contact formA partial and a shortcode for a static Hugo site GDPR compliant contact formEU storage, a DPA and retention you set Kontaktformular nach DSGVOAuf Deutsch: gespeichert in Deutschland, mit AVV JavaScript contact formA fetch script that keeps the visitor on the page Vercel contact formFor plain HTML, Astro or Next.js hosted on Vercel FormSubmit not workingThe usual causes of a silent FormSubmit form Web3Forms not workingThe usual causes of a silent Web3Forms form Eleventy contact formAn include for a static Eleventy (11ty) site Formspree not workingThe usual causes of a silent Formspree form Export from FormspreeEvery Formspree submission, as a file Export from FormsparkEvery Formspark submission, as a file EmailJS not workingThe usual causes of a silent EmailJS form Form backend for AI agentsThe start request, every REST route and MCP tool Claude Code contact formOne prompt, then press Activate Cursor contact formThe prompt and the .cursor/mcp.json entry Contact form privacy policyThe paragraph to copy, in 8 languages GitHub Pages contact formFor user, organisation and project sites on github.io Cloudflare Pages contact formFor sites on pages.dev or your own domain Netlify contact formFor sites on netlify.app or your own domain React contact formOne component for Vite and other React apps Next.js contact formA client component that works with output: export Send form submissions to multiple emailsUp to 5 confirmed addresses per form, plus yours SvelteKit contact formOne Svelte 5 component, any adapter Nuxt contact formOne Vue component for Nuxt 4 and 3 Gatsby contact formOne component for a Gatsby 5 site HTML form webhookSigned JSON to your endpoint for every message Jekyll contact formAn include for Jekyll, on GitHub Pages or any host Angular contact formA standalone component that posts with HttpClient Contact form spamWhy forms get spam, and the layers that stop it Contact form honeypotThe hidden field that catches bots, and how to hide it Contact form without PHPFor hosts with no PHP, or mail() that lands in spam HTML form mailtoWhy action="mailto:" fails on webmail visitors, and the one-line fix Contact form templateThe same form in plain HTML Pricing€1 per form a month, €0.50 from the 11th

Get your form address in a minute

14 days free, no card. Then €1 per form a month, €0.50 from the 11th form.

Start your 14-day trial