splitforms.com

HTML · THE FORM ELEMENT

HTML Form — working code, live demo, and how to make it submit

Last reviewed

An HTML form is created with the <form> element and collects user input through controls like <input>, <textarea>, and <select>. It sends that data to a server using the action URL and an HTTP method (usually POST). Below is a complete, working form you can copy — it submits to a free backend, no server required.

  • Live, editable example
  • Copy-paste snippet
  • Attributes & common mistakes
Live demo · nothing is sent

What gets submitted

Fill in the form above and press its button. The demo stops the request and lists every name=value pair the browser would send, plus the controls it leaves out.

With a free access key in the form, these fields land in your splitforms dashboard; access_key and botcheck are read by splitforms, not stored as lead data.

Edit the HTML and re-run it
Runs in a sandbox. Nothing is sent.

Minimal snippet

form-example.html
<form action="/contact" method="post">
  <label for="email">Email</label>
  <input type="email" id="email" name="email" required>
  <button type="submit">Send</button>
</form>

Copy-paste code

HTML Form code you can paste today.

Replace YOUR_ACCESS_KEY with a key from your free splitforms dashboard. The form posts to one endpoint — submissions land in your inbox and dashboard with spam filtering built in.

Get free access key
form.html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

  <label for="name">Name</label>
  <input type="text" id="name" name="name" placeholder="Your name" required>

  <label for="email">Email</label>
  <input type="email" id="email" name="email" placeholder="you@example.com" required>

  <label for="message">Message</label>
  <textarea id="message" name="message" placeholder="How can we help?" required></textarea>

  <!-- Honeypot: hidden from humans, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none">

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

Attributes · <form>

Which HTML Form attributes matter?

These attributes decide how the <form> behaves and what actually gets emailed to your inbox when someone submits.

HTML Form attributes and what each one does
AttributeWhat it does
actionThe URL the form data is sent to. Omitting it submits to the current page.
methodget (default, appends data to the URL) or post (sends data in the request body — use this for real forms).
enctypeHow data is encoded. Use multipart/form-data when the form includes file uploads.
targetWhere to show the response. _blank opens it in a new tab; _self is the default.
novalidateDisables the browser's built-in validation. Usually leave it off so HTML validation runs.
autocompleteon (default) lets the browser pre-fill fields like name, email, and address.

Common mistakes

HTML Form not working? Here's why.

Most broken forms come down to a few small mistakes with the <form>. Check these before you ship, then forward every submission to Slack or a webhook.

  1. Every field needs a name

    A control without a name= attribute is not included in the submitted data. The id is for labels and anchors — it is not sent anywhere.

  2. Use POST for real submissions

    GET appends fields to the URL, exposing emails and messages to logs and history. POST keeps data in the request body.

  3. A button inside the form submits it

    A <button> with no type defaults to type="submit". Use type="button" when you only want it to run JavaScript.

Sources: WHATWG HTML Standard: <form> · MDN: <form>

Copy-paste ready

The HTML Form example below is a complete, working form — paste it into any HTML page and it submits, no edits to the markup required.

No backend to build

Your html form form posts to one endpoint. No server, PHP, or API route — accepted submissions are saved to your dashboard before owner notification email is attempted; delivery time and inbox placement depend on provider and recipient settings.

A form that really submits

Unlike a static reference snippet, this <form> form actually sends data to a free splitforms backend, with spam filtering built in.

How it works

How to add HTML Form to any page.

Copy the html form example, drop in your free access key, and paste it into any page — submissions start landing in your dashboard.

Copy the code

Copy the HTML Form example below.

Add your access key

Replace YOUR_ACCESS_KEY with a free splitforms key from the dashboard.

Paste into your site

Drop the form into any HTML page. Submissions arrive in your dashboard.

Questions

HTML Form questions, answered.

View all FAQs
What is an HTML form?

An HTML form is a <form> element that collects user input through controls like text fields, checkboxes, and buttons, then sends that data to a server URL specified by the action attribute using an HTTP method such as POST.

How do I make an HTML form actually send email?

Point the form's action at a form backend endpoint (like splitforms.com/api/submit) and include your access key as a hidden field. The backend receives the submission and forwards it to your inbox — you never expose your email address or run a server.

What is the difference between form action GET and POST?

GET appends the form data to the action URL as a query string and is meant for searches and read-only requests. POST sends the data in the request body and is the correct method for contact, registration, and order forms because it keeps large and sensitive data out of the URL.

Do I need a backend to receive an HTML form?

No. A hosted form backend like splitforms lets you post the form directly from static HTML. Accepted submissions are saved in the dashboard before owner notification email is attempted; delivery time and inbox placement depend on provider and recipient settings. Spam filtering is included, and Free covers 500 submissions total.

Why is my HTML form not submitting?

The most common causes are a field missing a name= attribute, a <button> with type="button" instead of submit, a JavaScript handler calling preventDefault(), or the action URL being wrong. Check the Network tab — a successful POST returns a 200 with JSON.

Simple pricing

How much does splitforms cost?

Free gives you 500 submissions for $0 — no card, no time limit. Pro is $5/month for 5,000 submissions a month, and Annual is $49/year for 15,000 a month with every Pro feature.

Free

$0— 500 submissions
 

No card, no time limit

Best for testing

For side projects and indie devs.

  • 500 free submissions
  • Unlimited forms
  • Email notifications included
  • Smart spam filtering
  • Submissions dashboard
  • Redirect after submit
  • MCP server included

Annual

$49/ year
About $4.08 per month, billed yearly
Best value

Every Pro feature with triple the volume — $0.27 per 1,000 at full use.

  • 15,000 submissions per month
  • Unlimited forms
  • Everything in Pro
  • File uploads with 5 GB storage
  • 3 team seats
  • Priority email support

No credit card required on Free • Cancel anytime • Full pricing and FAQ