Hi all,
I am trying to achieve to hook up the key press event, currently I am using the technique below :
Which works only fine when I am not calling the SetHTML method, as soon as I call this method none of the onkeypress events gets called and even if I try to set them back right after I've called the SetHTML nothing happens. I've also tried the OnAfterSetHTML event of the editor without success. Is there something I am missing or maybe its not possible to attach events once the SetHTML call has been done ? I am a bit desperate on this ...
function FCKeditor_OnComplete(editorInstance)
{
var oEditor = FCKeditorAPI.GetInstance(richEditorId) ;
// Get the Editor Area DOM (Document object).
var oDOM = oEditor.EditorDocument ;
if ( document.all ) // If Internet Explorer.
{
oDOM.attachEvent("onkeypress", MyMethod)
}
else
{
oDOM.addEventListener("keypress", MyMethod,false);
}
}
Many thanks,
Thomas
I am trying to achieve to hook up the key press event, currently I am using the technique below :
Which works only fine when I am not calling the SetHTML method, as soon as I call this method none of the onkeypress events gets called and even if I try to set them back right after I've called the SetHTML nothing happens. I've also tried the OnAfterSetHTML event of the editor without success. Is there something I am missing or maybe its not possible to attach events once the SetHTML call has been done ? I am a bit desperate on this ...
function FCKeditor_OnComplete(editorInstance)
{
var oEditor = FCKeditorAPI.GetInstance(richEditorId) ;
// Get the Editor Area DOM (Document object).
var oDOM = oEditor.EditorDocument ;
if ( document.all ) // If Internet Explorer.
{
oDOM.attachEvent("onkeypress", MyMethod)
}
else
{
oDOM.addEventListener("keypress", MyMethod,false);
}
}
Many thanks,
Thomas