【问题标题】:Forcing Numeric Keyboard in Internet Explorer on Windows Phone 7.5在 Windows Phone 7.5 上的 Internet Explorer 中强制使用数字键盘
【发布时间】:2014-12-17 16:36:02
【问题描述】:

您好,我正在为 Windows Phone 7.5 开发一个 Jquery Mobile 网站,输入字段如下:

<input type="number" />

不幸的是,它显示了一个字母键盘。

有没有办法强制使用数字键盘?

谢谢

【问题讨论】:

    标签: html windows-phone-7 jquery-mobile


    【解决方案1】:

    我发现使用:

    <input type="tel">
    

    最适合我。对于 windows phone(在 8.1 上测试),模式技巧不起作用(即使它适用于 iOS 和可能的 android)。我不想使用 type="number" 因为在 html 上会显示箭头以在大多数浏览器中选择数字,而我正在为邮政编码这样做,所以这没有意义。我没有看到在 html 端使用 'tel' 类型有任何不利之处。

    我知道这是一个老问题,但由于那里没有很多 WP 答案,它可能会对某人有所帮助。

    【讨论】:

      【解决方案2】:

      尝试将输入类型设置为:

      • type="email"
      • type="url"
      • type="tel"

      或者(参考:Text, Web, and Editing Programming Guide for iOS

      <input type="text" pattern="\d*"></input>
      

      相关:

      【讨论】:

        【解决方案3】:

        要强制使用数字键盘,请使用以下命令:

        <input type="text" pattern="[0-9]" />
        

        来源:http://www.w3schools.com/html5/att_input_pattern.asp

        【讨论】:

        • 我认为这不适用于 Windows Phone 上的 Internet Explorer。
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-07-09
        • 1970-01-01
        • 2012-11-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多