splitforms.com

HTML · FORM CONTROL

HTML input type="text": Single-Line Text Fields

Last reviewed

The <input type="text"> control collects a single line of text. Text is the default input type: if type is missing or unknown, the browser falls back to text.

  • 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-type-text-example.html
<label for="full-name">Full name</label>
<input type="text" id="full-name" name="full_name" autocomplete="name" required>

Copy-paste code

<input type="text"> 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-type-text.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" autocomplete="name" maxlength="100" required>

  <label for="email">Email</label>
  <input type="email" id="email" name="email" autocomplete="email" required>

  <label for="subject">Subject</label>
  <input type="text" id="subject" name="subject" placeholder="How can we help?" maxlength="120">

  <label for="message">Message</label>
  <textarea id="message" name="message" rows="5" required></textarea>
  <button type="submit">Send message</button>
</form>

Reference

Which attributes work with input type=text?

Use these attributes to name the field, guide input and apply browser validation. Validate submitted values on the server too.

Which attributes work with input type=text?
AttributeWhat it does
nameThe key sent with the field's value; an unnamed input is omitted.
valueSets the initial text; the current value is submitted.
placeholderShows a short hint when empty; it does not replace a label.
requiredRequires a nonempty value for browser validation.
maxlengthLimits input length in UTF-16 code units.
minlengthSets the minimum length for a nonempty value in UTF-16 code units.
patternA regular expression the entire nonempty value must match.
sizeA suggested visible width in characters, not a length limit.
readonlyPrevents editing while still allowing the named value to be submitted.
disabledDisables the control and excludes it from submission.
autocompleteHints at the data to fill, with tokens such as name, given-name, family-name or organization.
inputmodeHints at a virtual keyboard, such as text or numeric; it does not validate.
spellcheckHints whether the browser should check spelling: true or false.
listReferences the id of a datalist offering suggestions.

Sources: MDN: text input

Input types

When should you choose another input type?

Choose the type that matches the data so browsers can offer the appropriate keyboard or validation.

When should you choose another input type?
TypeUse it for
emailEmail addresses, with built-in format validation.
telTelephone numbers, often with a phone-friendly keyboard.
urlURLs, with built-in URL validation.
searchSearch queries, with browser-specific search controls.
numberNumbers where a numeric value and step controls make sense, not identifiers such as postal codes.

Sources: WHATWG HTML Standard: input types

Attributes · <input type="text">

How are text input values named?

A name identifies the submitted value.

<input type="text"> attributes and what each one does
AttributeWhat it doesDocs
nameThe form data key; see [name](/html/name-attribute).MDN
valueThe initial value of the field; see [value](/html/value-attribute).MDN

Common mistakes

Text input mistakes to avoid

Give every field a label and choose limits deliberately.

  1. A placeholder is not a label

    Always associate a visible <label for="..."> with the input id. Placeholder text disappears as the user types and is only a hint.

  2. Size is not a length limit

    The size attribute suggests a visible width in characters. CSS width controls layout more flexibly; use maxlength to limit the entered length.

  3. Empty values are still submitted

    An enabled named text field sends its current value as a name=value pair, including an empty string such as subject=. Form encoding determines how that text is transmitted; disabled or unnamed controls are omitted.

Sources: WHATWG HTML Standard: Text state · MDN: <input type="text">

Copy-paste ready

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

How it works

How to add <input type="text"> to any page.

Copy the <input type="text"> example, drop in your free access key, and paste it into any page — submissions start landing in your dashboard.

Copy the code

Copy the <input type="text"> 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

<input type="text"> questions, answered.

View all FAQs
Is text the default input type in HTML?

Yes. An omitted or unrecognized type falls back to the text state, so `<input name="name">` is a text field.

Can placeholder replace a label?

No. Add a visible label with a for attribute matching the input id; use placeholder only for a short hint.

What is the difference between size and maxlength?

Size suggests the visible width in characters. Maxlength limits the value length in UTF-16 code units; CSS width controls layout.

What does an empty text input submit?

An enabled input with a name submits that name with an empty string, unless another condition excludes it from the form data.

Should an email address use text or email?

Use type="email" for an email address. It provides email format validation and can show an appropriate mobile keyboard.

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