D
Doug Lerner
(Using Prototype library)
I am checking for a keypress event, which triggers this handler:
function txKeyPressHandler(theEvent) {
var key = theEvent.which || theEvent.keyCode;
switch (key) {
case Event.KEY_RETURN:
txIMSendMsg();
break;
}
}
inside txIMSendMsg() I do:
var msg = $F('msg');
Field.clear($('msg'));
In other words, after saving the value of the field I clear it out.
Then when I'm all done with what I am doing I do:
Field.focus($('msg'));
The first time I enter the window the "msg" textarea is empty and the cursor
is at the beginning of the field. But after I enter text and press RETURN
the next time the focus returns to the 2nd line of the text area, like the
RETURN I entered to trigger the event remains in the msg textarea, even
though it was cleared.
Any idea why and how to avoid this?
Thanks!
doug
I am checking for a keypress event, which triggers this handler:
function txKeyPressHandler(theEvent) {
var key = theEvent.which || theEvent.keyCode;
switch (key) {
case Event.KEY_RETURN:
txIMSendMsg();
break;
}
}
inside txIMSendMsg() I do:
var msg = $F('msg');
Field.clear($('msg'));
In other words, after saving the value of the field I clear it out.
Then when I'm all done with what I am doing I do:
Field.focus($('msg'));
The first time I enter the window the "msg" textarea is empty and the cursor
is at the beginning of the field. But after I enter text and press RETURN
the next time the focus returns to the 2nd line of the text area, like the
RETURN I entered to trigger the event remains in the msg textarea, even
though it was cleared.
Any idea why and how to avoid this?
Thanks!
doug