I have a textbox and it has onkeyup event.
For example,
onkeyup = function() {
//some business logic to get the final value
//finalValue = blahblahblah;
this(this is current textbox object).value = finalValue;
}
It works ok. However, the issue I have is that...whenever the textbox value is updated, if you typed longer than textbox width, then the cursor position won't locate the last...hard to explain..hum...I guess whenever it is updated, it just set the cursor position the front....
I could position the cursor always at the last in the keyup event using a sort of javscript, but then I couldn't scroll the all the way first part of textbox value....
I think there got to be some better way to handle this.
If your text value is updated in keyup event, how would you preserve current position?
Bookmarks