πŸ”§ Developer Guide

Form Backend for HTML Forms
(No Server Required)

What a form backend is, why you need one for static sites, what features to look for, and exactly how to wire one up β€” with copy-paste code.

πŸ“– 9 min readβš–οΈ Services comparedπŸ’» Ready-to-use code

What is a form backend?

A form backend (also called a form endpoint or form handler service) is a hosted API that receives HTML form submissions and does something useful with them β€” most commonly, emails them to you.

When you build a static site, your HTML files live on a CDN. There's no server-side code to run. A form backend fills that gap. Instead of pointing your form at a PHP script you wrote, you point it at a URL the backend service gives you.

πŸ’‘
One-sentence definition A form backend is an API endpoint that accepts your form's POST request and forwards the data to your email, Slack, database, or webhook β€” so you don't have to build or host any server code.

The concept is simple but powerful. It decouples your beautiful front-end form from the messy plumbing of email delivery, spam filtering, and data storage β€” all of which the backend service handles on its infrastructure.

How it works

The flow from submission to inbox

πŸ™‹

Visitor fills form

β†’
πŸ“€

Browser POSTs to endpoint

β†’
⚑

Backend validates & stores

β†’
πŸ“§

Email sent to you

Your HTML and CSS never change. The backend is invisible to your visitors.

From a code perspective, the only change to your form is the action attribute:

HTML
<!-- Before: points nowhere useful -->
<form action="#" method="POST">

<!-- After: points at your form backend endpoint -->
<form action="https://api.submitrax.com/f/YOUR_FORM_ID" method="POST">

Everything else stays the same: your inputs, your labels, your CSS, your JavaScript. The backend just handles what happens after "Submit" is clicked.

Features to look for in a form backend

Not all form backends are equal. Here's what matters when you're choosing one:

Must-haves

  • Email notifications β€” every submission forwarded to your inbox, immediately.
  • Spam filtering β€” at minimum, honeypot support. Ideally reCAPTCHA integration too.
  • HTTPS endpoint β€” your form POST must go over TLS, full stop.
  • CORS support β€” needed if you're using JavaScript / fetch to submit asynchronously.
  • No server required on your end β€” the whole point is you don't manage infrastructure.

Nice-to-haves

  • Submissions dashboard β€” view all past submissions, search, export to CSV.
  • Custom redirect β€” send users to your own thank-you page after submitting.
  • File upload support β€” accept attachments in form submissions.
  • Auto-responder β€” automatically email the person who submitted the form.
  • Multiple forms per account β€” manage contact form, newsletter form, and feedback form from one dashboard.
⚠️
Watch out for tight submission limits on free plans Some services cap free plans at 50–100 submissions per month, and charge steeply above that. Make sure the service's pricing matches your expected volume before committing.

Implementation guide

Here's every pattern you'll need, from the simplest setup to fully async with validation.

Pattern 1: Basic (no JavaScript)

The simplest possible form. Works on any browser. Redirects to your thank-you page on success.

HTML
<form
  action="https://api.submitrax.com/f/YOUR_FORM_ID"
  method="POST"
>
  <input type="hidden" name="_redirect"
         value="https://yoursite.com/thanks">
  <input type="text"   name="name"    required>
  <input type="email"  name="email"   required>
  <textarea            name="message"></textarea>
  <button type="submit">Send</button>
</form>

Pattern 2: Async with inline success message

Use fetch to submit without navigating away, then show a confirmation in-place:

HTML + JS
<form id="myForm">
  <input name="name" placeholder="Name" required>
  <input name="email" type="email" required>
  <textarea name="message"></textarea>
  <button type="submit" id="submit-btn">Send</button>
</form>
<div id="success" hidden>
  βœ… <strong>Message received!</strong> We'll reply within 24 hours.
</div>

<script>
const form = document.getElementById('myForm');
const btn  = document.getElementById('submit-btn');

form.addEventListener('submit', async (e) => {
  e.preventDefault();
  btn.disabled = true;
  btn.textContent = 'Sending…';

  try {
    const res = await fetch(
      'https://api.submitrax.com/f/YOUR_FORM_ID',
      {
        method: 'POST',
        body: new FormData(form),
        headers: { Accept: 'application/json' }
      }
    );
    if (!res.ok) throw new Error();
    form.hidden = true;
    document.getElementById('success').hidden = false;
  } catch {
    btn.textContent = 'Error β€” try again';
    btn.disabled = false;
  }
});
</script>

Pattern 3: With spam protection (honeypot)

A honeypot field is hidden from humans but visible to bots. If it's filled in, the submission is spam:

HTML
<form action="https://api.submitrax.com/f/YOUR_FORM_ID" method="POST">
  <!-- Real fields -->
  <input name="name"    type="text"  required>
  <input name="email"   type="email" required>
  <textarea name="message"></textarea>

  <!-- Honeypot: hidden from humans, attracts bots -->
  <input
    type="text"
    name="_gotcha"
    style="display:none;visibility:hidden;position:absolute"
    tabindex="-1"
    autocomplete="off"
  >

  <button type="submit">Send</button>
</form>

Advanced patterns

Sending to multiple recipients

Most form backends let you configure multiple notification emails from the dashboard. Some also support a hidden field to CC or BCC additional addresses per-form.

Collecting extra data silently

Use hidden fields to pass metadata β€” page URL, campaign source, or a form version tag β€” without showing it to the visitor:

HTML
<form action="https://api.submitrax.com/f/YOUR_FORM_ID" method="POST">
  <!-- Visible fields … -->
  <input name="name" required>
  <input name="email" type="email" required>

  <!-- Hidden metadata passed with every submission -->
  <input type="hidden" name="_source"  value="homepage-hero">
  <input type="hidden" name="_version" value="v2">

  <button type="submit">Send</button>
</form>

File uploads

Set enctype="multipart/form-data" on the form and add a file input. Check that your chosen backend supports file uploads (not all do):

HTML
<form
  action="https://api.submitrax.com/f/YOUR_FORM_ID"
  method="POST"
  enctype="multipart/form-data"
>
  <input name="name"  type="text"  required>
  <input name="email" type="email" required>

  <!-- File input β€” supported by SubmitraX -->
  <label>Attach a file
    <input name="attachment" type="file" accept=".pdf,.png,.jpg">
  </label>

  <button type="submit">Submit</button>
</form>

🎯 Live demo β€” try all three patterns

Demo powered by SubmitraX. Create yours free.

βœ‰οΈ Ready in 60 seconds

Get your form backend with SubmitraX

Create an endpoint, point your HTML form at it, and start receiving submissions β€” email notifications, spam filtering, and a dashboard included. No server, no code, no hassle.

Create your free endpoint β†’
βœ“ Unlimited forms on free planβœ“ Email notificationsβœ“ Spam filtering built-in