The Current State of HTML5 Forms

The tel Type

<input type="tel">
(<input type=tel size=3>) <input type=tel size=3> - 
    <input type=tel size=4>

Live Demo


() -

Firefox
4+
Safari
5+
Safari Mobile
iOS 3.1+
Chrome
6+
Opera
10.6+
IE
10+
Android
2.3+
Supported Supported Supported Supported Supported Supported Supported

Supported Browser Screenshots

Mobile Safari (iOS 3.1)
Android 4.3

The Low Down

The tel input type is for telephone numbers.

  • Because different countries have different phone number lengths and different ways of writing phone numbers, there is no single regular expression that would match all countries. Therefore, there are no default restrictions on valid values and by default browsers do no validation. For example, a random value like "abc" will pass validation.
  • If you need to enforce a specific syntax for acceptable phone number use the pattern attribute (RegEx validation).
  • Touch devices with touchpads display the phone keypad, which make it difficult, if not impossible, to enter anything invalid.
  • Falls back to a regular text input.
  • Doesn't need to be a single field: For example, you can include three fields to emphasise USA's area-code structure and simplify validation.