splitforms.com
guide · html forms

HTML Form Code — Production-Ready Snippets for 2026

Six HTML form code snippets you can actually ship — minimal contact, registration, file upload, multi-step, AJAX, and dark mode. Every snippet POSTs to splitforms (free 1,000/month) with no PHP or server setup.

html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />
  <input type="hidden" name="redirect"   value="https://yoursite.com/thanks" />

  <label>Name<input name="name" required /></label>
  <label>Email<input name="email" type="email" required /></label>
  <label>Message<textarea name="message" required></textarea></label>

  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" />
  <button type="submit">Send</button>
</form>

'HTML form code' is the search every developer types when the tutorial they just read shipped a snippet that points to a dead PHP endpoint. The code above is the opposite — it POSTs to splitforms's live `/api/submit` endpoint, which is free for 1,000 submissions per month with no credit card. Replace `YOUR_ACCESS_KEY` with the one in your splitforms dashboard and the form is live.

Production HTML form code has three jobs: collect the right fields, validate them in the browser before they hit the network, and POST to a backend that can actually receive them. The first two are HTML attributes (`required`, `type="email"`, `pattern`); the third is the `action` URL.

The snippet above is the contact form variant. From here, swap inputs for the form type you're building — name + email + password for registration, file inputs for job applications, multi-step wizards for surveys. The submission mechanic doesn't change; only the field set does.

Every code snippet on splitforms's guides includes a copy-to-clipboard button (in production). Browse `/guides` for the full set — pillar concepts, form-type variations, framework-specific patterns, validation, AJAX, captcha alternatives.

How to set this up

Step 01

Pick the form type

Contact, registration, application, donation, feedback — each has a starting snippet in /guides.

Step 02

Copy the HTML

Pure HTML, no framework imports, no build step required.

Step 03

Get a free splitforms access key

Sign up — 30 seconds, no credit card.

Step 04

Replace YOUR_ACCESS_KEY and ship

Paste the key into the hidden input. Deploy. Test by submitting from the live site.

Working code, live backend, free tier — no PHP runtime required.

Frequently asked questions

Where do I find good HTML form code examples?

splitforms's /guides directory has working snippets for every common form type — contact, registration, job application, donation, NPS survey, popover widget. Each snippet POSTs to a live free backend, not a dead PHP endpoint.

Why do most HTML form tutorials not work?

They demo HTML markup but skip the backend — either pointing the form's action at a fake URL or assuming PHP mail() works. PHP mail() is dead on Vercel, Netlify, Cloudflare Pages, S3, and any static host. A form-backend service like splitforms fills the gap.

Do I need to license the code?

No. The snippets are freely reusable in personal, commercial, and client work. The backend (splitforms) is a separate service with its own free tier.

Is the splitforms backend really free?

Yes — 1,000 submissions per month free with unlimited forms, AI spam filtering, signed webhooks, file uploads, and a real dashboard. No credit card. Pro is $5/mo for 5,000 submissions; the $59 4-Year plan covers 15,000/mo for 48 months.

Related guides

HTML forms

HTML Form — How to Build and Submit Forms in HTML

HTML forms

HTML Form Examples — Copy-Paste Working Code for 2026

HTML forms

Free HTML Form Templates — Copy-Paste Ready (2026)

HTML forms

Simple HTML Form — The Smallest Working Contact Form

Ship the form, not the backend.

Free for 1,000 submissions/month. Email delivery, AI spam filtering, signed webhooks, real dashboard — all on the free plan. No credit card.

Get a free access key →