All guides

Contact form for Lovable

Lovable builds React + Vite + Tailwind apps from chat. When you ask it for a working contact form it often reaches for Supabase (a table plus an edge function and an email provider). For a contact or lead form that is more moving parts than you need. Pasteform gives you a public endpoint; one prompt tells Lovable to post the form there.

Get my free form link Replace YOUR_FORM_ID below with your form ID, or copy the snippets from your dashboard where it's already filled in.

Step by step

  1. Log in to Pasteform with GitHub or Google and click Create my form. Copy the prompt shown under Lovable, Bolt, v0; it already contains your form ID.
  2. In Lovable, open your project chat and paste the prompt. Lovable updates your contact component to send a fetch POST to your endpoint, with a hidden _gotcha honeypot field.
  3. Open the preview, submit the form once and check your inbox (and the Submissions list in Pasteform).
  4. Publish. Then, in Pasteform form settings, add your published domain (for example yourapp.lovable.app) and your custom domain to Allowed domains so other sites can't post to your form.

Prompt to paste into Lovable

Connect the contact form on this site to Pasteform (a hosted form backend).
- On submit, POST the fields as JSON to https://forms.prizenlabs.com/f/YOUR_FORM_ID with headers
  "Content-Type: application/json" and "Accept: application/json".
- Name the visitor email field "email". Add a hidden honeypot input "_gotcha" (display:none, tabIndex -1).
- If the response is ok and data.success is true, reset the form and show a toast "Thanks! We'll be in touch soon."
  Otherwise show data.message as an error toast.
- Do NOT create a Supabase table, edge function, API route or secret for this form. The endpoint is public.
Keep the current design. (Form ID: YOUR_FORM_ID)

What the component ends up looking like

import { useState } from "react";

export default function ContactForm() {
  const [state, setState] = useState<"idle" | "sending" | "sent" | "error">("idle");
  const [error, setError] = useState("");

  async function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
    e.preventDefault();
    setState("sending");
    const form = e.currentTarget;
    const res = await fetch("https://forms.prizenlabs.com/f/YOUR_FORM_ID", {
      method: "POST",
      headers: { "Content-Type": "application/json", Accept: "application/json" },
      body: JSON.stringify(Object.fromEntries(new FormData(form))),
    });
    const data = await res.json().catch(() => ({}));
    if (res.ok && data.success) {
      form.reset();
      setState("sent");
    } else {
      setError(data.message ?? "Something went wrong");
      setState("error");
    }
  }

  if (state === "sent") return <p>Thanks! We'll be in touch soon.</p>;
  return (
    <form onSubmit={handleSubmit} className="space-y-3">
      <input name="name" placeholder="Name" required />
      <input name="email" type="email" placeholder="Email" required />
      <textarea name="message" placeholder="Message" required />
      <input name="_gotcha" className="hidden" tabIndex={-1} autoComplete="off" />
      <button type="submit" disabled={state === "sending"}>
        {state === "sending" ? "Sending…" : "Send"}
      </button>
      {state === "error" && <p role="alert">{error}</p>}
    </form>
  );
}

Allowed domains

Add the published hostname (e.g. yourapp.lovable.app) and your custom domain. While testing in the editor preview, either leave the allow-list empty or add the preview hostname shown in your browser's address bar.

Common pitfalls

What you get

Make your Lovable form send

Free form link in about 2 minutes. No credit card.

Get my free form link

Guides for other platforms

Bolt · v0 · Framer · Webflow · Astro · Next.js · Hugo · Jekyll · GitHub Pages · Netlify · Vercel · WordPress (static export) · Carrd · plain HTML