admin管理员组文章数量:1310136
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?
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?
Share Improve this question asked Sep 11, 2014 at 12:00 Pablo JomerPablo Jomer 10.4k11 gold badges59 silver badges104 bronze badges 2- possible duplicate of Can Android WebView HTML influence keyboard or keyboard features? – CodingIntrigue Commented Sep 11, 2014 at 12:09
- What kind of input are you referring to? Please show an example of HTML code. – Jukka K. Korpela Commented Sep 11, 2014 at 12:10
2 Answers
Reset to default 8<input type="text" autocapitalize="none">
This works for me.
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 overe 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
本文标签: javascriptAndroid keyboard defaults to capitalized first for html inputStack Overflow
版权声明:本文标题:javascript - Android keyboard defaults to capitalized first for html input - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741848608a2400927.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论