3

I am trying to force iOS to show a numeric keyboard for my password field. I use

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

It works fine in iOS7 but looks like they have changed their policy for password fields. Any suggestion how to force a numeric keyboard on a password field in iOS8 ?

2 Answers2

0

since they changed some parts of the password policity settings i dont think that it is possible to let a password field open a numeric keyboard. maybe you could try to go to the numeric keyboard anotherway round by just giving the it a diffrent input type like

<input type="number"/>

<input type="tel"/>

if this not works you could also try to use

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

by giving the input type a simple text and forcing it to open the numeric keyboard with \d* like you already tried it in your code

maybe this link could be helpful for further information: https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

Ferdinand Fatal
  • 374
  • 3
  • 16
  • That is fine, but I want to display the input as **** not plain text. – DestructiveCreator Oct 01 '14 at 12:48
  • It's been a while you asked this question, but other than this [workaround](http://stackoverflow.com/a/8334379/2493019), did you find a solution? I've got the same problem :( – Lave Loos Aug 11 '15 at 13:27
0

The best way is use css

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

this work on ios and android device but windows devices have problem

.pass{
    -webkit-text-security: disc;
    -moz-webkit-text-security: disc;
    -moz-text-security: disc;
}
Ben
  • 47
  • 1
  • 5