How can I stop auto capitalization in a html text input field on an android/samsung phone?

12,552

Solution 1

You need to to say autocapitalize="off" in your markup

Example

<input type="text" autocorrect="off" autocapitalize="off"/>

Click here for more details.

Solution 2

For android phones you have to use autocomplete="off"

So if you want something generic, complete @kumars' answers this way:

<input type="text" autocorrect="off" autocapitalize="none" autocomplete="off"/>

The autocorrect and autocapitalize attributes works on the iPhone or the iPad, autocomplete is for any device running Android.

NB: Use autocapitalize="none" instead of autocapitalize="off" because "off" is deprecated for autocapitalize. See official documentation.

Share:
12,552
user1808407
Author by

user1808407

Updated on June 11, 2022

Comments

  • user1808407
    user1808407 almost 2 years

    I am trying to get all lowercase in a html text input field on a samsung android phone.

    Can anyone suggest something else to try to stop the auto capitalization for the first letter in a text field?

    I have tried the following and nothing works.

    • CSS

      .my_username{text-transform:lowercase;}
      
      input[type=text] {text-transform:lowercase;}
      
    • JS

      my_username.setAttribute("autocapitalize","off");
      
      in submitonenter(my_username.value.toLowerCase();)
      
    • HTML

      input autocapitalize="off" type="text" class="my_username" name="username" size="19" value="" maxlength="19" onkeypress="submitonenter(event,this)"