splitforms.com

HTML · FORM CONTROL

HTML input: all 22 types, attributes and what each sends

Last reviewed

The HTML <input> element is a form control whose type attribute decides what it accepts, how the browser validates it and what it submits. Types include text, email, password, number, checkbox, radio, file and date. An input is only submitted if it has a name attribute.

  • 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

input-example.html
<label for="email">Email</label>
<input type="email" id="email" name="email" required>

Copy-paste code

HTML Input 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
input.html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

  <label for="name">Full name</label>
  <input type="text" id="name" name="name" required>

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

  <label for="phone">Phone</label>
  <input type="tel" id="phone" name="phone" placeholder="+1 555 000 0000">

  <label for="qty">Quantity</label>
  <input type="number" id="qty" name="quantity" min="1" value="1">

  <label for="when">Preferred date</label>
  <input type="date" id="when" name="preferred_date">

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

All input types

What are the HTML input types?

The HTML Standard defines 22 input types. The type sets the control, the keyboard a phone shows, the check the browser runs before submit and the exact string the field sends. A missing or misspelled type falls back to text.

What are the HTML input types?
typeMobile keyboard or UIBuilt-in validationSubmitted valueGuide
textStandard keyboardOnly what you add: required, minlength, maxlength, patternThe text, with line breaks removed—
searchKeyboard whose enter key may read SearchSame as textThe text, with line breaks removedinput type=search
emailEmail keyboard, typically with an @ keyMust look like name@domainThe address with outer spaces trimmed; with multiple, a comma-separated listinput type=email
urlURL keyboard, often with a / keyMust be an absolute URL such as https://example.comThe URL with outer spaces trimmedinput type=url
telTelephone keypad: 0–9, * and #None: any text passes, so add pattern for a formatThe text as typedinput type=tel
passwordStandard keyboard, characters maskedSame as textThe text as typed, in plain text (serve the form over HTTPS)input type=password
numberNumeric keyboardBlocks non-numbers; checks min, max and stepA number string such as 2.5; empty when left blankinput type=number
rangeSlider, no keyboardNothing to fix: the value is kept between min and max (default 0 to 100)A number string; the midpoint unless value sets oneinput type=range
dateNative date pickerMust be a real date; checks min, max and stepyyyy-mm-dd, e.g. 2026-10-02input type=date
timeNative time pickerMust be a valid time; checks min, max and stepHH:mm, or HH:mm:ss with secondsinput type=time
datetime-localNative date and time pickerMust be a valid date and time; checks min, max and stepyyyy-mm-ddTHH:mm, with no time zoneinput type=datetime-local
monthMonth picker where supported; not Baseline, other browsers show a text boxMust be a valid month where supportedyyyy-mmDate and time inputs
weekWeek picker where supported; not Baseline, other browsers show a text boxMust be a valid week where supportedyyyy-Www, e.g. 2026-W40Date and time inputs
colorNative color pickerNothing to fix: a color is always pickedLowercase hex such as #ff4f00; never emptyinput type=color
checkboxTap to toggleWith required, it must be checkedIts value (or on) when checked; nothing when uncheckedHTML checkbox
radioTap to pick one of a groupWith required, one radio in the group must be pickedThe picked radio's value; nothing when none is pickedHTML radio button
fileFile picker, or the camera with captureWith required, a file must be chosen; accept is not checkedThe file with multipart/form-data, otherwise only its filenameHTML file input
hiddenNot shownNoneIts value, exactly as writteninput type=hidden
submitButtonNoneIts name=value, only when it is the button that submitted the formHTML button
imageImage used as a submit buttonNoneThe click position as name.x and name.y, only when it is the button that submitted the form—
resetButtonNoneNever submitted—
buttonButtonNoneNever submitted—

Keyboards follow the hints in MDN's inputmode reference; the exact layout depends on the phone's operating system and keyboard app. The Submitted value column is the string each field puts in the request; to send those values yourself as URL-encoded, multipart or JSON, see how to send form data to an API. To make a field mandatory, see the HTML required attribute.

Sources: WHATWG HTML Standard: the input element · WHATWG HTML Standard: constructing the entry list · MDN: <input> types · MDN: inputmode

Attributes by type

Which attributes work with which input types?

Most input attributes apply to only some types: pattern does nothing on a number field and accept does nothing outside type="file". A browser ignores an attribute that does not apply, so it will not warn you. name, value, disabled and form work on every type.

Which attributes work with which input types?
AttributeWorks on these typesWhat it does
requiredtext, search, url, tel, email, password, number, date, time, datetime-local, month, week, checkbox, radio, fileBlocks the submit until the field has a value, or the box is checked. See the required attribute.
placeholdertext, search, url, tel, email, password, numberA hint shown while the field is empty. It is not a label. See placeholder.
patterntext, search, url, tel, email, passwordA regular expression the whole value must match. See pattern.
minlength, maxlengthtext, search, url, tel, email, passwordThe shortest and longest value allowed, counted in characters. See minlength and maxlength.
sizetext, search, url, tel, email, passwordVisible width in characters. Style the width with CSS instead.
min, max, stepnumber, range, date, time, datetime-local, month, weekThe lowest value, the highest value and the allowed increments between them. See min and max and step.
readonlytext, search, url, tel, email, password, number, date, time, datetime-local, month, weekThe person cannot edit the value, but it is still submitted. A readonly field skips validation. See readonly.
listtext, search, url, tel, email, number, range, date, time, datetime-local, month, week, colorThe id of a <datalist> that supplies suggestions. See datalist.
autocompletetext, search, url, tel, email, password, number, range, date, time, datetime-local, month, week, colorTells the browser what to autofill, such as email or given-name. See autocomplete.
multipleemail, fileEmail takes a comma-separated list of addresses; file takes several files. See multiple.
accept, capturefileFilter the file picker; capture opens the camera on phones. See file input.
checkedcheckbox, radioStarts the control selected. See checkbox.
src, alt, width, heightimageThe picture used as the submit button, its alternative text and its size.
formaction, formmethod, formenctype, formnovalidate, formtargetsubmit, imageOverride the form's own action, method, enctype, novalidate and target for this one button. See formaction and form target.

Compiled from the HTML Standard's table of input type attribute applicability; the full matrix also lists the newer color attributes alpha and colorspace.

Sources: WHATWG HTML Standard: input type attribute summary · MDN: <input> attributes

Attributes · <input>

Which HTML Input attributes matter?

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

HTML Input attributes and what each one does
AttributeWhat it doesDocs
typeSets the control: text, email, tel, number, date, file, checkbox, radio, password, hidden, submit, and more.MDN
nameThe key the value is submitted under. Without it, the field is not sent at all.MDN
valueThe initial value. For text fields it's the default text; for checkbox/radio it's what gets sent when checked.MDN
placeholderA short hint shown when the field is empty. It is not a substitute for a <label>.MDN
requiredBoolean. The browser blocks submit and shows a hint if the field is empty.MDN
min / max / stepConstraints for number and date inputs. The browser validates against them.MDN
patternA regex the value must match. Pair it with a title= explaining the required format.MDN
autocompleteHints like "email", "tel", "given-name" that let browsers autofill correctly.MDN
idLinks the field to its <label for> and to CSS and scripts. It is never submitted; only name is.MDN
disabledBoolean. The field can't be edited, skips validation and is left out of the submission.MDN
readonlyBoolean. The field can't be edited but is still submitted. Works on text-like, number and date types.MDN
minlength / maxlengthThe shortest and longest text allowed, in characters. Re-check lengths on the server.MDN
multipleBoolean, for email and file only: accept several addresses or several files.MDN
acceptFor type="file" only: the file types the picker shows, e.g. .pdf or image/*.MDN
listThe id of a <datalist> whose options are offered as suggestions while typing.MDN
formThe id of a <form> elsewhere on the page, for a field that sits outside the form element.MDN

Common mistakes

HTML Input not working? Here's why.

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

  1. No name = no data

    An input without name= is dropped from the submission. id only wires up <label for> and anchors.

  2. type=email only checks format

    It validates the shape (a@b.co) but not whether the address is real or deliverable. Validate deliverability server-side.

  3. placeholder is not a label

    Placeholders vanish on focus and hurt accessibility. Always include a real <label> linked with for=.

  4. A misspelled type quietly becomes text

    type="emial" or any type a browser does not know falls back to text: no error, but the field loses its keyboard and its validation. Check the spelling against the input types table above.

  5. disabled fields are never sent

    A disabled input is left out of the submission and skips validation. To show a value people can't change but you still receive, use readonly instead.

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

Copy-paste ready

The HTML Input 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 input 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 <input> form actually sends data to a free splitforms backend, with spam filtering built in.

How it works

How to add HTML Input to any page.

Copy the html input 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 Input 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.

How SplitForms works

What happens after someone submits your form?

splitforms receives the submission, filters spam, saves it to your dashboard and emails you — then, on paid plans, sends it on to your webhooks and integrations. No backend infrastructure to build.

A SplitForms contact form submission launching straight to your inbox

Add your endpoint

Point your form to your unique SplitForms endpoint. That's it.

HTML form pointing at a SplitForms submit endpoint

Receive submissions

We instantly capture and organize every submission in your inbox.

Submissions inbox with searchable leads and status pills

Route anywhere

Send data to email, spreadsheets, CRMs, webhooks, and 7,000+ apps.

Generic integration tiles for email, sheets, chat, CRM, automate, and webhook

No credit card required. Set up in under 60 seconds.

Connect & automate

Where can submissions go besides email?

On paid plans, submissions can also go to Slack, Discord, Google Sheets, Notion, Airtable, Zapier or any signed webhook — and splitforms works on the platforms you build on, from WordPress and Shopify to Next.js. With Stripe connected, your forms can take payments too.

Connect your SplitForms form to Slack, Google Sheets, Mailchimp, Zapier and more
NewTake payments on your formsDeposits, bookings, order forms — submitters check out through Stripe and the money goes straight to your Stripe account. Included on every paid plan.See payment forms →Need time slots? Online booking →

Setup guides for the stacks you use

Questions

HTML Input questions, answered.

View all FAQs
What is the HTML input tag?

The <input> element is an HTML form control that lets users enter data. The type= attribute determines what kind of control it is — text, email, number, date, file, checkbox, radio, and others — each with built-in validation and an appropriate mobile keyboard.

What are the HTML input types?

The HTML Standard defines 22: text, search, email, url, tel, password, number, range, date, time, datetime-local, month, week, color, checkbox, radio, file, hidden, submit, image, reset and button. Each changes how the field behaves, validates, renders on mobile and what value it submits. A missing or unknown type falls back to text.

What are the attributes of the input tag?

The common ones are type, name, value, id, placeholder, required, disabled, readonly, min, max, step, minlength, maxlength, pattern, autocomplete, multiple, accept, list and form. Which ones apply depends on the type: pattern works only on text-like types and accept only on type="file". The attributes-by-type table on this page lists the full mapping.

What value does each input type submit?

Text-like types send the text as typed, number and range send a number string, date sends yyyy-mm-dd and color sends lowercase hex like #ff4f00. A checkbox or radio sends its value only when checked, a file sends the file only with enctype="multipart/form-data", and reset and button inputs are never sent.

How do I make a text input in HTML?

Use <input type="text" id="name" name="name"> with a <label for="name"> beside it. text is also the default type, so leaving type out gives the same single-line field. Add required, minlength, maxlength or pattern to validate it, and placeholder for a hint that never replaces the label.

What is the use of the input tag?

The input tag collects a single value from the user — a name, an email, a number, a chosen file — and submits it under its name= attribute when the form is posted to the server or backend.

How do I allow file uploads in HTML?

Use <input type="file" name="resume">, add enctype="multipart/form-data" to the <form>, and post to a backend that accepts files (splitforms supports uploads on paid plans with storage connected).

Why is my input value not submitting?

Almost always because the input is missing a name= attribute, the field is disabled, or it sits outside the <form>. Check that name= is set and the control is inside the form element.

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