splitforms.com

HTML · ATTRIBUTE

HTML size Attribute: Input Width and Select Listbox

Last reviewed

The size attribute sets the visible width in characters of an input with type text, search, tel, url, email or password. It takes a positive integer and defaults to 20. On a select, size sets the number of visible rows; a size greater than 1 or the multiple attribute displays a listbox. Size does not apply to input types such as number, date or checkbox.

  • 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

size-example.html
<label for="username">Username</label>
<input type="text" id="username" name="username" size="10">
<label for="topic">Topic</label>
<select id="topic" name="topic" size="4">
  <option value="sales">Sales</option>
  <option value="support">Support</option>
  <option value="billing">Billing</option>
  <option value="other">Other</option>
</select>

Copy-paste code

HTML size attribute 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
size-attribute.html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
  <label for="username">Username</label>
  <input type="text" id="username" name="username" size="10" maxlength="30" required>
  <label for="topic">Topic</label>
  <select id="topic" name="topic" size="4">
    <option value="sales">Sales</option>
    <option value="support">Support</option>
    <option value="billing">Billing</option>
    <option value="other">Other</option>
  </select>
  <input type="checkbox" name="botcheck" style="display:none">
  <button type="submit">Send</button>
</form>

Attributes · size

Which attributes affect size?

Use size for visible dimensions, maxlength for input length and CSS for layout.

HTML size attribute attributes and what each one does
AttributeWhat it doesDocs
sizeA positive integer: the approximate visible character width of a supported input, or the number of visible rows in a select.MDN
maxlengthLimits the length of a supported input's value; size controls its visible width instead.MDN
multipleAllows multiple selections and displays a select as a listbox, including when size is 1.MDN
width (CSS)CSS width overrides the input width suggested by size and offers more control over layout.MDN

Common mistakes

Size attribute mistakes to avoid

Separate the control's appearance from its value and selection behavior.

  1. Size is not maxlength

    A user can enter more characters than the visible width. Use maxlength to limit the input value's length.

  2. CSS width wins

    An explicit CSS width overrides the width suggested by size. Use CSS for responsive or precise control of the input's layout.

  3. Multiple still displays a listbox

    A select with multiple remains a listbox even with size="1". Size sets the visible row count, not whether multiple choices are allowed.

Sources: WHATWG HTML Standard: input size · MDN: size attribute

Copy-paste ready

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

How it works

How to add HTML size attribute to any page.

Copy the html size attribute 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 size attribute 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 size attribute questions, answered.

View all FAQs
What does size do on an input?

On text, search, tel, url, email and password inputs, size sets the approximate visible width in characters. It must be a positive integer and defaults to 20; it does not apply to number, date or checkbox inputs.

What is the difference between size and maxlength?

Size controls the visible width of a supported input. Maxlength limits the length of its value; size alone does not prevent typing more characters.

How does input size compare with CSS width?

Size suggests a visible width in characters, while CSS width controls layout in units such as pixels or percentages. An explicit CSS width overrides size.

How do I show all options of a select?

Set size to the number of options, for example size="4" for four options. The list can scroll when there are more options than visible rows; CSS and browser rendering can affect the final appearance.

Is size submitted with the form?

No. Size controls presentation and is not submitted. An enabled named input sends its name and value; a select sends the name and selected option value for each selected option.

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