Question: Question:
I am creating a mobile compatible site.
Is there a way to switch Android's input mode to a numeric keyboard when focusing on <input type="password">
?
I can switch to number input for feature phones ( istyle
, format
, mode
) and iPhone ( pattern="\d*"
), but only Android doesn't know how to switch to number input.
For Android, other number input fields change <input type="text">
to <input type="number">
so that you can enter numbers, but for the password input field, type="number"
If you specify type="number"
, masking will be lost, which is inconvenient.
I'm wondering if I can devise another method.
Answer: Answer:
It seems that you can make the numeric keypad appear in the type
attribute and mask it with style
-webkit-text-security: disc
as shown below.
<input type="number" style="-webkit-text-security: disc;">
Since I do not have an Android device at hand, I have not been able to confirm it on Android.
reference:
- CSS3 –Make input into hidden characters while specifying the numeric keypad on the keyboard with the input tag of the smartphone site -Qiita
- http://jsdo.it/blueberrystream/vB04 –jsdo.it ( Internet Archive )