87

I'm writing a login page for a mobile version of my webapp and I have a simple HTML password field like so:

<input id="password" type="password" />

The only problem is that the iPhone Safari browser capitalizes the first letter of the input by default, which is confusing my users as the password is case sensitive and they do not always realise this is the case.

Does anyone know of a method, tag or otherwise to stop this happening and force the iPhone input to lowercase unless the user specifies otherwise? Or is this simply a feature of the platform that can't be changed?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
Rory Harvey
  • 2,579
  • 2
  • 22
  • 27
  • 1
    the secure text is always case insensitive and the user name you can put the validation for the word capitalization in iphone. – B25Dec Jun 15 '11 at 10:15

2 Answers2

193
<input type="text" name="test1" autocapitalize="none"/>

The docs can be found here: Supported Attributes: autocapitalize

Gerben
  • 16,747
  • 6
  • 37
  • 56
  • 2
    Good answer. As Ballu mentions, though, this is unnecessary for input type=password. – IAmNaN Apr 09 '15 at 18:01
  • 4
    "off" was depreciated in iOS 5.0, you should use "none". This prevents autocapitalising, but the shift key will still be active by default which is a pain. – Patrick Nov 16 '15 at 12:36
66

You may want to turn off both autocorrect and autocapitalize for password and email fields.

Here are what mine look like:

<input autocapitalize="off" autocorrect="off" id="email" name="email" type="text">
<input autocapitalize="off" autocorrect="off" id="password" name="password" type="password">
digidigo
  • 2,534
  • 20
  • 26