0

I am writing because I have a problem with the input type password.

The problem is that I want only numbers in password. It means iPhones should enable the numeric keyboard, not the complete keyboard with letters. I've tried for look an answer for this question, but I've not found any solution. Thanks in advance.

  • possible duplicate of [iPhone UIWebview: How to force a numeric keyboard? Is it possible?](http://stackoverflow.com/questions/773843/iphone-uiwebview-how-to-force-a-numeric-keyboard-is-it-possible) – Matt Ball Oct 28 '11 at 15:53

1 Answers1

1

Try adding _zip or _phone to the end of your input name - iOS should see it as requiring the numeric keyboard. Not sure if this works with a type="password" field, you'll have to try.

<input type="string" name="tel_phone" />
<input type="password" name="pass_zip" />

Update

As per the link in Matt's comment, the best way to specify the numeric keyboard is to use type="number" - but that won't occlude the entry like a password field would. It's up to you!

Adam Hopkinson
  • 28,281
  • 7
  • 65
  • 99
  • [Out of date](http://stackoverflow.com/questions/773843/iphone-uiwebview-how-to-force-a-numeric-keyboard-is-it-possible). – Matt Ball Oct 28 '11 at 15:53
  • @Matt - that would be the best solution, but the OP is after a password field. Maybe he/she would be ok with the visibility of a number field. – Adam Hopkinson Oct 28 '11 at 15:56
  • mmmmh thank you for your reply... Unfortunely, I am a newbie in this framework and I have some trouble with jquery mobile. I tried your solution, but in the input password is still appearing the entire keyboard. As Matt said I need the option number in the password field. I'll be grateful if you help me to find the solution. Thank you – davosandoval Oct 28 '11 at 16:09