The Current State of HTML5 Forms

The inputmode Attribute

<input type="text" name="zip" inputmode="numeric">
<input type="text" x-inputmode="numeric">

Live Demo

Look what dynamic keyboard popped up on your touch device.
Test in Firefox
Firefox OS
Safari iOS
7-
Chrome
34-
Opera
20
IE
10
Android
4.4-
Kinda Supported Not Supported Not Supported Not Supported Not Supported Not Supported

The Low Down

The inputmode attribute tells the browser on devices with dynamic keyboards which keyboard to display. The inputmode attribute applies to the text, search and password input types as well as <textarea>.

  • Values of the inputmode attribute include:
    • verbatim for alphanumeric content,
    • latin text content with aids like auto suggest,
    • latin-name for names,
    • latin-prose text content with more aggressive text entry assistance then simple latin,
    • full-width-latin like latin-prose, but for your secondary languages,
    • kana full-width Japanese characters, with support for converting to kanji,
    • katakana Katakana input, full-width Japanese characters, with support for converting to kanji,
    • numeric for numeric input that isn't a number, like zip codes, credit card numbers, when you want numeric values, but don't want the GUI of a number spinner,
    • tel displays the telephone keyboard, including asterisk and pound key, but should not be used when tel input type makes sense, like for input of a social security number,
    • email the email input keyboard when <input type="email"> is not appropriate. For example, for a Twitter app you may want a keyboard that shows @, but you don't actually want to check for valid email addresses.
    • url for URL input keyboard when you don't actually want an URL, like when you don't want an URL, but don't want to force the inclusion of a protocol.
  • This attribute is only relevant in browsers on devices that have dynamic keyboards.
  • Firefox OS supports x-inputmode rather than inputmode.
  • Example use would be for zip codes in the United states: when you want a numeric keyboard, but you don't want the number spinner UI.