I'm trying to figure out how to return focus to the very first line of the textarea...currently, when the "enter" key is pressed, the value of the textarea is reset to an empty string, but the focus goes to the second line of the textarea instead of the first....here is my code:

The problem isn;t the javascript keycode here (as far as i can tell)....substituting 13 with 10 only made the script less functional than it already is....

the problem has something to do with the "enter" key moving focus to the second line...but I reset the value of the textarea to an empty string (before i reset focus to the texarea), so that should eliminate any extra line feeds?

chump2877

08-05-2006, 03:20 AM

No one knows the answer to this question?? It seems like it should be a no-brainer for the right person....thanks.

_Aerospace_Eng_

08-05-2006, 04:42 AM

Its not that no one knows, its that people have lives and can't answer every single question. Questions slip away. You just need to learn to be patient or start doing some searching on your own.

Its not that no one knows, its that people have lives and can't answer every single question. Questions slip away. You just need to learn to be patient or start doing some searching on your own.

Lol...Did someone wake up on the wrong side of the bed this morning? I didn;t think I was being offensive or necessarily "impatient" in my previous post, and that was quite an abrasive response [to my post]....And you think I didn;t try to scrounge up the answer to this question myself? I assure you I did some significant searching....time to bump it down a notch, chief...*sigh*

That being said, you were kind enough to reply to this post, and I do appreciate that...I'll implement your suggestions and see if it works for me...thanks! :thumbsup:

chump2877

08-05-2006, 05:47 AM

FWIW, it appears the problem was simply a case of me using the wrong event handler....substituting onKeyPress with onKeyUp in my previous code also does the trick: