Pablo Jomer
Pablo Jomer

Reputation: 10378

Android keyboard defaults to capitalized first for html input

I'm working on a HTML page. The page is used by multiple platforms: Ios, Android and Desktop. The problem I have is that on the android browser when I select an input the first letter is Capitalized by default. This is frustrating for users as all user names start with small letters. Is there a way to change this default?

Upvotes: 2

Views: 3541

Answers (2)

Leyiang
Leyiang

Reputation: 582

<input type="text" autocapitalize="none">

This works for me.

Upvotes: 8

Abdul Jabbar
Abdul Jabbar

Reputation: 2573

What you are talking about is related to the android Keyboard itself, as mostly keyboards have this option to capitalize the first word by default! In order to overcome this, in your html, you need to force the input to only show lowercase letters and convert all letters to lowercase, you can do it like this:

<input type="text" style="text-transform:lowercase;" on keyup="javascript:this.value=this.value.toLowerCase();">

See the DEMO here

Upvotes: 3

Related Questions