Force numeric keypad for ios8 password fields

I am trying to get iOS to show the numeric keypad for my password field. I use

<input type="password" pattern="\d*" name="pass"/>

      

It works fine in iOS7, but it looks like they changed their policy for password fields. Any suggestion how to force the numeric keypad into the password field in iOS8?

+3


source to share


2 answers


since they changed some parts of the password protection settings, I don't think it is possible to give the password field to open the numeric keypad. perhaps you could try to switch to the numeric keypad unilaterally by simply pointing your own input type to it, like

<input type="number"/>

<input type="tel"/>

      

If that doesn't work, you can also try using



<input type="text" pattern="\d*">

      

setting the input type to plain text and forcing it to open the numeric keypad with \ d * as you already tried in your code

Maybe this link can be helpful for more information: https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

0


source


The best way is to use css

<input type="text" class="pass" pattern="\d*">
<input type="number" class="pass" pattern="\d*">

      



this work on ios and android devices, but windows devices have problems.

.pass{
    -webkit-text-security: disc;
    -moz-webkit-text-security: disc;
    -moz-text-security: disc;
}

      

0


source







All Articles