javascript - How to Auto-Capitalize a text input in phonegap for Android? - Stack Overflow

Is there a (non hacking) way to set autocapitalize="on" (like iOS) in phonegap for Android?If

Is there a (non hacking) way to set autocapitalize="on" (like iOS) in phonegap for Android?

If not, is there any way to "auto press" shift after the user focuses on a form field such as <input ... type="text">?

Is there a (non hacking) way to set autocapitalize="on" (like iOS) in phonegap for Android?

If not, is there any way to "auto press" shift after the user focuses on a form field such as <input ... type="text">?

Share Improve this question edited Aug 24, 2012 at 22:21 David M 1,16112 silver badges22 bronze badges asked Jul 20, 2012 at 20:01 Julio RodriguesJulio Rodrigues 3,4134 gold badges25 silver badges33 bronze badges 0
Add a ment  | 

3 Answers 3

Reset to default 3

You can use a textarea width height: 22px (or more).

<textarea style="height: 22px" ...></textarea>

Discovered by accident, using ICS with cordova 1.9.0

via jQuery:

$('input[type="text"]').on('keypress', function() { 
    var $this = $(this), value = $this.val(); 
    if (value.length === 1) { 
      $this.val( value.charAt(0).toUpperCase() );
    }  
});

Just use css

input[type=text] {
    text-transform:uppercase;
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745637958a4637510.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信