Hi Everyone,
Is it possible to add onchange() event (just like the one which can be used in textarea) to Fckeditor? I'm currently stuck here, I need something like onchange() event to monitor the contents in fckeditor. Thanks in advance.
Is it possible to add onchange() event (just like the one which can be used in textarea) to Fckeditor? I'm currently stuck here, I need something like onchange() event to monitor the contents in fckeditor. Thanks in advance.
RE: onchange() event
Re: onchange() event
see topic: viewtopic.php?f=6&t=9999&p=26352#p26352
Re: onchange() event
I just came across this topic, even though it has quite some time now.
I need an onchange event, if the editor content changes because of a tool bar next to the FCK editor, that uses some of the edited content. Using the IsDirty() method is not sufficient because there I only get once the event at the first change.
In the fckplugin.js I added something like this:
window.frame[0] works for me, in a different content that might be another object.
Explanation:
My custom toolbar will be loaded clicking a button in the toolbar of the FCK editor. On load the 'keyup' event in the whole iframe (of the edit area) will be observed. Also the editor content is saved into a variable once.
Everytime the user releases a key (selecting, pressing a key etc. doesn't yet change the content) the content might have changed. Therefore the edited buffer is fetched again and checked if it differs from the saved content before. Only if this is the case I rebuild my custom toolbar content and save the new buffer content again to my variable. Therefore I make sure that updating my custom toolbar is done only when it's really neccessary.
Clicking on the button again hides my custom toolbar and also releases the event observation.
Drag and Drop with the mouse is not supported (even though it changes the content). Therefore some mouse events must be observed the same way as the keyup event.
HTH, Stephan