Friday, June 21, 2013

Turn off autocapitalize on iOS Safari

By default on iOS Safari input text or textarea enables automatic correction and capitalization to streamline mobile typing. However, sometimes, we don't want this, for instance username input text.

We can add autocapitalize="off" autocorrect="off" two attributes to disable this.

When I tested on iOS6.1.4, input email, input passsword don't auto capitalize the first character. Also show correct keyboard.

We can use HTML5 new input types to better control keyboard display
Text: <input type="text" /> <!-- display a standard keyboard -->
Telephone: <input type="tel" /> <!-- display a telephone keypad -->
URL: <input type="url" /> <!-- display a URL keyboard -->
Email: <input type="email" /> <!-- display an email keyboard -->
Zip Code: <input type="text" pattern="[0-9]*" /> <!-- display a numeric keyboard -->

For details, check out https://developer.apple.com/library/safari/#codinghowtos/Mobile/UserExperience/_index.html

No comments:

Post a Comment