使用可以吗?现在?

发布于 2024-08-31 19:20:40 字数 159 浏览 2 评论 0原文

我正在开发一个手机网络应用程序,并且有几个可以受益于 的文本字段。 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

红玫瑰 2024-09-07 19:20:41

是的,任何不受支持的类型都将恢复为“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

茶花眉 2024-09-07 19:20:41

当浏览器遇到不支持的输入类型时,将回退到 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".

抽个烟儿 2024-09-07 19:20:41

简短的回答:是的。正如 @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.

你爱我像她 2024-09-07 19:20:41

没关系。当浏览器遇到不支持的类型时,将使用type=text

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文