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">
?
3 Answers
Reset to default 3You 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;
}