splitforms.com

HTML · FORM CONTROL

HTML Textarea — multi-line input with a live working form

Last reviewed

The <textarea> element is a multi-line text input, used for messages, comments, and anything longer than a single line. Unlike <input>, it has opening and closing tags and a size set by rows and cols. Below is a working contact form with a message textarea that actually submits.

  • 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

textarea-example.html
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" cols="40"
          maxlength="1000" required></textarea>

Copy-paste code

HTML Textarea 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
textarea.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" required>

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

  <label for="message">Message</label>
  <textarea id="message" name="message" rows="5" cols="40"
            maxlength="1000" placeholder="Tell us what you need…"
            required></textarea>

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

Submitted value

What does a textarea submit?

A textarea sends its current text under its name, line breaks included as CRLF; an empty textarea still sends name with an empty value.

What does a textarea submit?
CaseWhat is sent
Typed line breaksEach line break is sent as CRLF, %0D%0A in URL-encoded form
wrap="soft" (the default)The text as typed, with no extra line breaks added at the visual wrap points
wrap="hard" with colsA line break is inserted at each point where the text wraps
Empty textareamessage= — the name is sent with an empty value
disabledNothing: a disabled control is left out of the form data
readonlyIts text, unchanged: a readonly control is still submitted
First newline right after <textarea>Dropped by the parser, so it never reaches the submitted value

The HTML Standard normalises every line break in the value to CRLF before the form data is built, so a textarea always submits \r\n even when the visitor's system uses \n.

Sources: WHATWG HTML Standard: the textarea element

Comparison

Textarea vs input: which should you use?

Use <textarea> for anything that can span more than one line, and <input type="text"> for a single line. They differ in how the default value is set, how size is controlled, and what the form submits.

Textarea vs input: which should you use?
<textarea><input type="text">
LinesMulti-line; Enter adds a line breakSingle line; Enter submits the form
Default valueText between the tagsThe value attribute
Sizerows and cols, then CSSsize attribute, then CSS
Line breaks submittedYes, as CRLFNo
Resize handleYes, unless resize: noneNo

Sources: WHATWG HTML Standard: the textarea element · MDN: <input type="text">

Attributes · <textarea>

Which HTML Textarea attributes matter?

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

HTML Textarea attributes and what each one does
AttributeWhat it does
rowsThe visible height in text lines. Sets the default size; CSS height overrides it.
colsThe visible width in average characters. Prefer CSS width for real layouts.
maxlengthMaximum number of characters the user can type. Enforce length limits server-side too.
placeholderA hint shown when the textarea is empty. Not a replacement for a <label>.
requiredBoolean. Blocks submit if the textarea is empty.
wrapsoft (default) submits only the line breaks the user typed; hard also inserts a line break at each visual wrap on submit and needs cols.
minlengthMinimum number of characters before the form can submit.
readonlyThe user cannot edit the text, but it is still submitted.
disabledNot editable and not submitted with the form.
spellchecktrue or false: turns the browser's spell checking on or off.

Common mistakes

HTML Textarea not working? Here's why.

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

  1. Default content goes between the tags

    Unlike <input value="...">, a textarea's default text is written between <textarea> and </textarea>. Watch for leading whitespace — it shows up in the submitted value.

  2. rows/cols are a fallback

    They set a rough default size. For real layouts, control height and width with CSS so the field matches your design.

  3. maxlength is client-only

    A determined user can remove it in DevTools. Re-validate the length on the server before storing or forwarding the message.

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

Copy-paste ready

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

How it works

How to add HTML Textarea to any page.

Copy the html textarea 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 Textarea 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 Textarea questions, answered.

View all FAQs
What is a textarea in HTML?

A <textarea> is a multi-line text input control. It lets users enter longer content like a message, comment, or description, and submits whatever was typed under its name= attribute when the form is posted.

What is the correct HTML for making a text area?

Use <textarea name="message" rows="5" cols="40"></textarea>. The rows and cols attributes set the default size, and the name= attribute is required for the value to be submitted.

How are textarea cols and rows measured?

rows is the visible height measured in lines of text. cols is the visible width measured in average character widths. Both are approximate — use CSS width and height for precise layouts.

How do I limit textarea length?

Add maxlength="1000" to cap the number of characters the user can type, then check the length again server-side since the attribute can be removed in the browser.

Should I use input or textarea?

Use <input type="text"> for a single line (name, email, subject) and <textarea> for anything that may span multiple lines (message, bio, feedback). Textarea resizes and wraps; a text input does not.

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