结合文本输入类型jQuery的手机 [英] combine text input types jquery mobile
问题描述
在此链接中: http://jquerymobile.com/demos/1.2 .0 / docs / forms / textinputs / 底部有几种不同的文本输入类型。
现在我的问题是如何将 tel 和密码类型结合起来? 类型使用户能够在移动设备上显示数字键盘(键盘),如果该类型获得焦点而不是显示常规键盘。 密码类型隐藏了用户键入的字符。由于我的网页上的密码只包含数字,所以如果我可以将 tel 类型和密码类型的功能组合起来,那将是非常好的。
$ b $你可以使用 pattern =[0-9] *
属性来达到这个目的: / p> < input type =passwordname =passwordpattern =[0-9] *id =password value =placeholder =输入您的数字密码>
完全适用于iOS。
in this link: http://jquerymobile.com/demos/1.2.0/docs/forms/textinputs/ at the bottom there are several different text input types.
Now my question is how could I combine the tel and password types? The tel types enables the user to display the number pad (key pad) on the mobile device if that type receives focus instead of showing the regular keyboard. The password type hides the characters that the user types. Since the password on my webpage will only consists of digits it would be nice if I could combine the functionality of the tel type and password type.
You can use pattern="[0-9]*"
attribute to achieve this:
<input type="password" name="password" pattern="[0-9]*" id="password" value="" placeholder="Enter your numeric password">
It totally works on iOS.
这篇关于结合文本输入类型jQuery的手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!