combine text input types jquery mobile

十年热恋 提交于 2019-12-12 01:19:14

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/14328983/combine-text-input-types-jquery-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!