PDA

View Full Version : inputtext focus


mallesh
11-26-2003, 04:09 AM
Hi Antun,

In my application, i want to display the text from the inputtext dynamically.Here,onkeydown event working fine in my application but the problem is it always dispaly one letter less than the actual length of the text untill hit the ENTER key .Once i hit the ENTER key,the that last letter is going to dispaly.

How can i rectify this problem?

this is my example code (attached)

Thanks
Mallesh

antun
11-26-2003, 08:29 AM
The reason is that the onkeydown event gets sent as soon as the key goes down, whereas the text in the field you're typing to will only get updated when the key goes back up.

Since you're reading the text from the field (getText()), you need the text to update before you read it. Use the onkeyup event instead.

-Antun