View Full Version : [RESOLVED]HTMLEditor - Changing Enter key behavior

21 Jan 2009, 8:12 AM
Hi Folks,

I've looked for a while, but cannot find what I need. Is there anyway to get rid of the blank line in the editor after pressing the ENTER key? I'm using the HTMLeditor in a chat window and do not want the blank line and want the cursor to be positioned back at the beginning of the field after pressing the ENTER key and the message is sent.

Thanks for your time!

21 Jan 2009, 9:29 AM
why not just remove the trailing line break before submitting it?

21 Jan 2009, 9:52 AM
jgarcia -

Thanks for the reply. I've tried soo many things but nothing seems to work. From calling execCmd('delete') to putting the textarea in a loop calling delete, to trying setPosition() to setValue(), setRawValue(), but couldn't get them to work. I'm also calling .reset() after sending the message. I've been at it a while now, so I know that it's just me missing something stupid, just can't figure out what that is.

If you have an example, I would appreciate it greatly!

Thanks again,

21 Jan 2009, 10:06 AM
Ah, so you want the Enter key to fire the submit action, no?

21 Jan 2009, 10:08 AM
Try extending the onEditorEvent method.

24 Jan 2009, 11:09 PM

My apologies for just now getting back to replying to you. I was able to get past this problem through some code that I was able to adapt from another example.