Keep your website's form and design. Connect it to a SmartFormify endpoint to receive answers in your response dashboard.
Connect your form
- Open your endpoint, enable it, and copy the full submission URL and generated integration example.
- Add the example to your website. Give each input a name and keep the generated hidden bot field empty.
- Publish the form, submit one test, and confirm it appears in the correct form's response dashboard.
For developers
A normal HTML form uses method="POST" and the endpoint URL as its action. For a JavaScript submission, call event.preventDefault() in the submit handler and send the named fields as JSON or FormData. This JSON example sends text fields:
const response = await fetch("YOUR_ENDPOINT_URL", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
data: { email: "you@example.com", message: "Test enquiry" },
}),
});
const result = await response.json();
if (!response.ok || !result.success) {
throw new Error(result.message || "Submission failed.");
}
// Show confirmation or follow result.data.redirect_url.
In React, use the form's onSubmit handler. In Next.js, browser submit handlers belong in a Client Component with 'use client'. Show a loading state, disable repeat submissions while sending, and preserve entered values on failure.
Common questions
Why does the page reload?
A normal HTML POST navigates after submission. For a form that stays on the page, use Fetch and call preventDefault() before awaiting the request.
Why are fields or checkbox values missing?
Inputs need a name; disabled inputs and unchecked checkboxes are omitted. When converting FormData to JSON, use getAll() for repeated field names: Object.fromEntries() keeps one value per key. Let the browser set Content-Type when sending FormData.
How do I prevent duplicate responses?
Use one submit handler and block repeat clicks while sending. If retrying an uncertain request, check the dashboard first. JavaScript or server integrations can reuse an Idempotency-Key for the same unchanged submission; its replay protection is temporary and does not replace the in-flight guard.
Complete examples: HTML, JavaScript, React, and Next.js.