Hi there,
I want to use FCK Editor for text area in chat.
I want when ENTER is pressed the message to be sent. But I cannot attach my function onkeydown.
function FCKeditor_OnComplete( editorInstance )
{
editorInstance.EditorDocument.body.document.onkeydown = FckEditorKeyDown;
}
function FckEditorKeyDown()
{
var editorInstance = FCKeditorAPI.GetInstance('<%= FCKeditorChatText.ClientID %>');
var e = editorInstance.EditorWindow.event;
//alert(e.keyCode);
if(e.keyCode == 13)
{
var message = editorInstance.GetData();
// Sent message (move it to another textarea)
// Clear the FckEditor text
editorInstance.SetData("");
}
}
Unfortunally this work only the first time, when I want to sent second message, nothing happens.
Thanks
I want to use FCK Editor for text area in chat.
I want when ENTER is pressed the message to be sent. But I cannot attach my function onkeydown.
function FCKeditor_OnComplete( editorInstance )
{
editorInstance.EditorDocument.body.document.onkeydown = FckEditorKeyDown;
}
function FckEditorKeyDown()
{
var editorInstance = FCKeditorAPI.GetInstance('<%= FCKeditorChatText.ClientID %>');
var e = editorInstance.EditorWindow.event;
//alert(e.keyCode);
if(e.keyCode == 13)
{
var message = editorInstance.GetData();
// Sent message (move it to another textarea)
// Clear the FckEditor text
editorInstance.SetData("");
}
}
Unfortunally this work only the first time, when I want to sent second message, nothing happens.
Thanks