Lovable contact form not sending? Fix it in 2 minutes
Make a form in your Lovable app deliver its submissions to a dashboard, without setting up a database or backend.
Lovable builds React apps, and the forms it generates usually look complete: fields, validation and a success toast. Often, though, the submit handler only shows that toast or logs the data. Nothing is saved, and nobody is notified.
This guide connects the form to FormRhythm so every submission is stored in a dashboard you can check, with no database tables, edge functions or API keys to set up.
1. Create your endpoint
Sign up for FormRhythm (the Free plan includes 100 submissions a month), create a form, and copy its endpoint:
https://www.formrhythm.com/f/YOUR_FORM_ID2. Paste this prompt into Lovable
Replace YOUR_FORM_ID with your form's ID, then send this in your Lovable project's chat:
Connect the contact form to my form backend at
https://www.formrhythm.com/f/YOUR_FORM_ID
- Keep the form's current design, fields, validation and toast messages.
- Give every input, textarea and select a descriptive name attribute.
- In the submit handler, POST the form with fetch, using new FormData(form)
as the body and the header Accept: application/json.
- Show the existing success toast only when the response is ok, reset the
form, and show an error toast with the response's "error" message otherwise.
- Disable the submit button while the request is in progress.
- Add a spam honeypot: a text input named _gotcha, hidden off-screen with CSS
(not type="hidden"), with tabindex="-1" and autocomplete="off".
- Do not add a database, Supabase table, edge function or API route for this,
and do not put any secrets in the code.The last line matters. Without it, an AI builder may decide to create a database table or backend function for the form, which is more to maintain and isn't needed.
3. Publish and test
Publish your app, open the live URL, and submit the form once. The submission should appear in your FormRhythm dashboard within a second or two.
Test on the published site rather than only in the editor preview, so you're testing exactly what your visitors will use.
What the code should look like
If you prefer to check or edit the code yourself, the submit handler should look roughly like this:
const ENDPOINT = 'https://www.formrhythm.com/f/YOUR_FORM_ID';
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
setIsSubmitting(true);
try {
const response = await fetch(ENDPOINT, {
method: 'POST',
body: new FormData(event.currentTarget),
headers: { Accept: 'application/json' },
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(error || 'Something went wrong');
}
event.currentTarget.reset();
toast({ title: 'Message sent', description: "We'll get back to you soon." });
} catch (error) {
toast({
title: 'Could not send your message',
description: error instanceof Error ? error.message : 'Please try again.',
variant: 'destructive',
});
} finally {
setIsSubmitting(false);
}
}Each input needs a name, for example <Input name="email" type="email" />. The name becomes the field label in your dashboard.
Troubleshooting
The toast says "sent" but nothing arrives
The handler is still showing the toast without sending anything. Check that it calls fetch with your endpoint, and that the toast only runs after response.ok. Ask Lovable: "The form shows success but doesn't send. Make the submit handler POST to my endpoint before showing the toast."
Some fields are missing in the dashboard
Those inputs have no name attribute. Ask Lovable to add descriptive names to every field.
Lovable created a Supabase table or edge function instead
Ask it to remove them and use only a fetch POST to your endpoint. You don't need any backend for this.
I get an error toast
The message comes from FormRhythm and says what's wrong, such as a form set to Draft or a monthly limit reached. See limits and error codes.
Next steps
- Accept file uploads, such as CVs or screenshots.
- Send submissions to your own system with signed webhooks.
- Redirect to your own thank-you page.