Is it okay to use <input type="tel"/> now?
Asked Answered
C

4

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?

Chercherbourg answered 11/5, 2010 at 19:55 Comment(3)
Unfortunately, the Opera Mobile browser will show a regular text input field, with the normal QWERTY keyboard instead of the numeric one.Define
A few years later and we now have caniuse.com/#feat=input-email-tel-urlLudovika
I think BEST reference is MDNShiri
F
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

Florie answered 11/5, 2010 at 20:4 Comment(3)
I tested using browserstack on ie 7, 8, 9 on a project and everything defaulted to type text.Backchat
@animuson. I'm not sure how to contact you so forgive this off-topic intrusion on your answer. Please see my meta post regarding your deleting my Topic today. Thank you for your time.Entertainer
nice link .. thanxKenishakenison
W
23

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

Wagram answered 11/5, 2010 at 20:1 Comment(0)
E
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.

Elkins answered 11/5, 2010 at 20:3 Comment(0)
A
1

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

Aaron answered 2/6, 2021 at 17:55 Comment(1)
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?Griff

© 2022 - 2024 — McMap. All rights reserved.