i am creating a web page for mobile devices. In that there are few input fields which require user to always enter data in uppercase.
I looked at few options like
text-transform
property of css
It changes user input to uppercase but it also changes the placeholder. That doesn't looks good.autocapitalize
attribute for input
By setting it on, it allows keyboard to open in caps. But this doesn't seems to work for me. It works perfectly withtextarea
but not withinput
in android.
Is there any better way to achieve this?
You should be able to bind to a keydown or keypress event (I'd use jQuery) and modify the input.
It won't affect the soft keyboard; maybe you can use this along with
autocapitalize
?