108

I'm working on a mobile phone web app and I have several text fields that could benefit from <input type="tel"/>. iPhones will adjust the keyboard for the user, but I'm worried about breaking backwards compatibility. What I'm hoping is that browsers/phone that support this can assist the user and other browser will fall back to a standard text field? Is this an acceptable practice? Does it even work?

Ry-
  • 218,210
  • 55
  • 464
  • 476
Michael
  • 3,498
  • 5
  • 27
  • 32
  • Unfortunately, the Opera Mobile browser will show a regular text input field, with the normal QWERTY keyboard instead of the numeric one. – andreszs Sep 12 '14 at 18:40
  • A few years later and we now have http://caniuse.com/#feat=input-email-tel-url – John Magnolia Nov 16 '16 at 17:24
  • I think BEST reference is [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) – T04435 Feb 17 '17 at 07:19

4 Answers4

131

Yes, any unsupported type will revert to the 'type=text' format.

I found a good page which lists out all the existing input types. I tried looking at it from different browsers, a bit interesting. Don't know if it will help you or not.

http://miketaylr.com/pres/html5/forms2.html

animuson
  • 53,861
  • 28
  • 137
  • 147
23

Browsers will fall back to type="text" when they encounter unsupported input type. So I think it's OK to use type="tel".

15

Short answer: yes. As @el.pescado mentions, browsers fall back to type=text when they don't understand the type. For more info about the other cool features you get from HTML5 forms, check out A Form of Madness, which is the forms chapter in Dive Into HTML5.

Hank Gay
  • 70,339
  • 36
  • 160
  • 222
1

It is ok. Browsers will use type=text when they encounter unsupported types.

  • There are four other answers to this question, most of them 11 years old, which already explain this information. Can you add some information not already covered by the other answers, to make it worth keeping? – Roddy of the Frozen Peas Jun 03 '21 at 02:26