splitforms.com

HTML · GLOBAL ATTRIBUTE

HTML inputmode attribute: pick the mobile keyboard

Last reviewed

inputmode only hints which virtual keyboard a phone shows: none, text, decimal, numeric, tel, search, email or url. Unlike type, it adds no validation and doesn't change the submitted value. For digit strings that aren't quantities, like ZIP codes, use type="text" inputmode="numeric" with pattern, so leading zeros are kept.

  • 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

inputmode-example.html
<input type="text" name="zip" inputmode="numeric" pattern="[0-9]{5}" autocomplete="postal-code">

Copy-paste code

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

  <label for="zip">ZIP code</label>
  <input type="text" id="zip" name="zip" inputmode="numeric" pattern="[0-9]{5}" autocomplete="postal-code" required>

  <label for="code">One-time code</label>
  <input type="text" id="code" name="code" inputmode="numeric" autocomplete="one-time-code" pattern="[0-9]{6}">

  <label for="amount">Amount</label>
  <input type="text" id="amount" name="amount" inputmode="decimal">

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

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

inputmode values

Which keyboard does each inputmode value show?

Each inputmode value asks the phone for a different on-screen keyboard, while the field still accepts and submits whatever text is typed.

Which keyboard does each inputmode value show?
ValueKeyboard shownUse it for
noneNo on-screen keyboardFields that open your own picker or keypad
textThe standard keyboard (the default)Ordinary text
decimalDigits plus a decimal separatorPrices, amounts, weights
numericDigits 0–9 onlyZIP codes, one-time codes, card numbers, PINs
telTelephone keypad with 0–9, * and #Phone numbers (prefer type="tel")
searchStandard keyboard with a Search keySearch boxes (prefer type="search")
emailKeyboard with @ and . keysEmail addresses (prefer type="email")
urlKeyboard with / and . keysWeb addresses (prefer type="url")

The exact layout depends on the phone OS and the keyboard app the visitor uses.

Sources: MDN: inputmode

Attributes · inputmode

Which attributes go with inputmode?

inputmode picks the keyboard. These attributes add the checks and autofill it leaves out.

HTML inputmode attribute attributes and what each one does
AttributeWhat it doesDocs
inputmodeThe keyboard hint, like inputmode="numeric". It changes only the on-screen keyboard, not what the field accepts.MDN
patternA regular expression the whole value must match, like [0-9]{5}. Add it, because inputmode checks nothing.MDN
autocompleteLets the browser fill the field, such as postal-code or one-time-code for codes sent by SMS.MDN
enterkeyhintSets the label of the Enter key on mobile keyboards, such as next, done or send.MDN

Common mistakes

inputmode mistakes to avoid

Most problems come from using type="number" for codes, or expecting inputmode to validate.

  1. Don't use type=number for ZIP codes or card numbers

    type="number" drops leading zeros, adds spinner arrows and can change the value when the visitor scrolls. Use type="text" with inputmode="numeric" for digit strings that aren't quantities.

  2. inputmode adds no validation

    A visitor can still paste or type letters. Add pattern, like [0-9]{5}, and check the value again on the server.

  3. Desktop browsers ignore it

    inputmode only changes on-screen keyboards. On a laptop with a physical keyboard, nothing changes.

  4. numeric has no minus or decimal key on iPhone

    The iOS numeric keypad shows only digits. Use inputmode="decimal" for amounts that need a decimal point.

  5. Don't add it to email, tel or url inputs

    type="email", type="tel" and type="url" already show the right keyboard. Adding inputmode there is redundant.

Sources: WHATWG HTML Standard: inputmode · MDN: inputmode

Copy-paste ready

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

How it works

How to add HTML inputmode attribute to any page.

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

View all FAQs
What is the difference between inputmode and type="number"?

type="number" makes a number field: it blocks non-numbers, adds spinners, checks min, max and step, and drops leading zeros. inputmode="numeric" only shows a number keyboard on phones; the field stays a text field and sends exactly what was typed.

How do I show a numeric keyboard for a ZIP code?

Use <input type="text" inputmode="numeric" pattern="[0-9]{5}" autocomplete="postal-code">. Phones show a number keyboard, the pattern checks for five digits, and a ZIP like 02134 keeps its leading zero.

Does inputmode validate the input?

No. inputmode only changes the on-screen keyboard. Visitors can still paste letters, so add pattern for a browser check and validate the value on the server.

What is the difference between inputmode decimal and numeric?

numeric shows digits 0 to 9 only. decimal adds the decimal separator for the visitor's locale, such as a dot or comma, so use it for prices and amounts.

Does inputmode work on iPhone and Android?

Yes. Safari on iOS and Chrome on Android both support inputmode and switch the on-screen keyboard. The exact layout depends on the OS and the keyboard app, and desktop browsers ignore it.

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