Form in Cursor
Tell the agent not to add an API route. The form talks to Formgong directly.
- Open the site repo in Cursor.
- Paste the prompt.
- Confirm there is no server secret just for this form.
- Export CSV from the dashboard when leads arrive.
Prompt
Add a contact form that posts to Formgong. Do not create an API route in this repo. Endpoint: POST https://formgong.com/submit Public access_key: fk_your_access_key Fields: name, email, message, and a hidden botcheck honeypot. Support both HTML form posts and JSON fetch. For fetch, send Accept: application/json and check the success flag. Do not send files.
fetch
async function onSubmit(event) {
event.preventDefault();
const fields = Object.fromEntries(new FormData(event.currentTarget));
const response = await fetch("https://formgong.com/submit", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({ ...fields, access_key: "fk_your_access_key" }),
});
const result = await response.json();
if (!result.success) throw new Error(result.message || "Formgong error");
}