jquery - 在 iPhone 中禁用数字键盘解析

标签 jquery iphone html jquery-mobile keyboard

我需要一个同时具有数字和 - 符号的键盘,因为缺少 input="tel"我想我会使用 input="number"代替,但是每当我完成输入时,它都会将数字解析为另一种格式,例如:“19880522-3243”变为“19 880 522”。

有谁知道我如何获得带“-”的数字键盘或禁用 input="number"时发生的解析?

最佳答案

如 jQuery Mobile 中指定的那样 documentation .引用网站:

In jQuery Mobile, you can use existing and new HTML5 input types such as password, email, tel, number, and more. Some type values are rendered differently across browsers. For example, Chrome renders the range input as a slider. jQuery Mobile standardizes the appearance of range and search by dynamically changing their type to text. You can configure which input types are degraded to text with the page plugin's options.

One major advantage of using these more specific input types if that on mobile devices, specialized keyboards that speed data entry are offered in place of the standard text keyboard. Try the following inputs on a mobile device to see which display custom keyboards on various platforms.

虽然文档中没有明确说明,但检查示例的来源表明可以使用 type="" 定义输入类型。属性。试一试:

<input type="tel" name="tel" id="tel" value="" />

关于jquery - 在 iPhone 中禁用数字键盘解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12007407/

相关文章:

javascript - 表单的id怎么写

iphone - UITextView 和 UIPickerView 都有自己的 UIToolbar

css - Bourbon 整洁和语义化的 HTML5,BEM 呢?

html - CSS 表 ID 选择

javascript - 如何在 $.ajax 请求上设置超时并在超时时重做?

javascript - jQuery Mobile 1.0 是否支持 Windows Mobile 6.5?

jquery - 如何在类里面更改 Font Awesome ?

ios - Theos实例方法调用

iphone - 如何获取 UITableview 中第一个单元格 (x, y) 的确切起始位置?

jquery - 为产品定制界面加载图像的最佳实践