I'm pretty sure you already know all the new HTML5 types for the input element, such as type=email , that trigger different virtual keyboards on touch devices. While on Android and Windows Phone you will get a fully numeric keypad when using type=number, you might not realize that on iOS you don't get exactly that.
If you want to get a fully numeric keypad on ios, you have to add a pattern value on the input element. By default, the number type will allow the user to type letters
If you add a pattern="[0-9]*" attribute then you will get a truly numeric keypad in iOS as in other operating systems:
If you want to get a fully numeric keypad on ios, you have to add a pattern value on the input element. By default, the number type will allow the user to type letters
If you add a pattern="[0-9]*" attribute then you will get a truly numeric keypad in iOS as in other operating systems:
<input type="number" pattern="[0-9]*">
You can also use this trick with type="password" to get a numeric keypad for a PIN text field.
You can also use this trick with type="password" to get a numeric keypad for a PIN text field.
<input type="password" pattern="[0-9]*">
0 comments:
Post a Comment