使用可以吗?现在?
我正在开发一个手机网络应用程序,并且有几个可以受益于 的文本字段。 iPhone 会为用户调整键盘,但我担心会破坏向后兼容性。我希望支持此功能的浏览器/手机可以帮助用户,而其他浏览器将回退到标准文本字段?这是可以接受的做法吗?它甚至有效吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,任何不受支持的类型都将恢复为“type=text”格式。
我找到了一个很好的页面,其中列出了所有现有的输入类型。我尝试从不同的浏览器查看它,有点有趣。不知道对你是否有帮助。
http://miketaylr.com/pres/html5/forms2.html
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
当浏览器遇到不支持的输入类型时,将回退到 type="text"。所以我认为使用 type="tel" 就可以了。
Browsers will fall back to type="text" when they encounter unsupported input type. So I think it's OK to use type="tel".
简短的回答:是的。正如 @el.pescado 提到的,当浏览器不理解类型时,它们会回退到
type=text
。有关从 HTML5 表单 获得的其他炫酷功能的更多信息,请查看 A Form of Madness,这是《Dive Into HTML5》中的表单章节。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.没关系。当浏览器遇到不支持的类型时,将使用
type=text
。It is ok. Browsers will use
type=text
when they encounter unsupported types.