Setting up a Form Backend
If you already have a beautifully designed form on your website and just need a reliable backend to handle submissions, validation, and spam protection, our Form Backend feature is exactly what you need. In this guide, we'll walk you through creating an endpoint and connecting your code.
Step 1: Get Your Endpoint URL
To start, you need to generate a unique API endpoint for your custom form.
- Create a new form and navigate to the Editor tab in your dashboard.
- Select Form Backend mode instead of using the drag-and-drop builder.
- You will be provided with a unique endpoint URL. It will look like this:
https://mimoforms.com/api/forms/[YOUR_FORM_ID]/submit - Copy this URL to your clipboard.
Step 2: Connect Your HTML Form
The easiest way to connect your form is by setting the action attribute on your standard HTML <form> tag.
- Open your website's source code.
- Find your existing
<form>tag. - Set the
actionattribute to the endpoint URL you copied in Step 1. - Set the
methodattribute toPOST.
<form action="https://mimoforms.com/api/forms/[YOUR_FORM_ID]/submit" method="POST"> <input type="text" name="name" placeholder="Your name" required> <input type="email" name="email" placeholder="Your email" required> <textarea name="message" placeholder="Your message" required></textarea> <button type="submit">Send</button> </form>
[!NOTE]
Make sure all your input fields have anameattribute. This is how Mimo Forms identifies the data columns in your submissions table!
Step 3: Connect using JavaScript (Optional)
If you are submitting via AJAX in a modern frontend framework like React, Next.js, or Vue, you can simply POST a JSON payload to your endpoint.
- Prevent the default form submission event in your frontend code.
- Construct a JSON object containing your form data.
- Use the
fetchAPI to send aPOSTrequest to your endpoint.
fetch("https://mimoforms.com/api/forms/[YOUR_FORM_ID]/submit", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: "Jane Doe", email: "jane@example.com", message: "Hello!" }), });
Step 4: Enable Spam Protection (Honeypot)
To prevent bot submissions without using annoying visual CAPTCHAs, you can enable our built-in Spam Protection.
- In your Mimo Forms dashboard, toggle on Spam Protection.
- Add a hidden
_gotchafield to your HTML form.
<!-- Add this hidden input anywhere inside your <form> tag --> <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
[!TIP]
Bots automatically fill out all fields they find. If our endpoint detects that the_gotchafield contains any text, the submission is silently rejected!
Can't find what you're looking for?
Our support team is always here to help you get the most out of Mimo Forms. Reach out to us anytime!
Contact Support