I am trying to convert the characters in the textbox to upper case.
But this seems to affect my cursor position.
JS fiddle below:
$(this).val($(this).val().toUpperCase());
If I type on a blank textbox everything is fine… but If i try to type inbetween the text the cursor immediately goes to the end of the word.
How can I prevent it from happening, my cursor should be where I stopped typing, not at the end of the text.
Works fine in Firefox, IE screws it up. I need it working on IE
This can also be accomplished via CSS:
Put this in your HTML page and the textbox will force all text input to be
uppercase. There are additional modifiers:
lowercase, capitalize, none, inherit
Of course, this can be browser-dependent, but seems to be supported in most
browsers.
I have updated your sample adding the text-transform style and switching the jquery event bind from keyup to change :
http://jsfiddle.net/ZdRnZ/6/