开发者

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

I'm working on a mobile phone web app and I have several text fields that could benefit from <input type="tel"/>. iPhones wi开发者_Go百科ll 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?


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


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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜