I have an instance of CKEditor on a form. I'm using this JQuery to monitor for changes to the fields on the page:
$("input, select, textarea)
.change(function() {
isDirty = 'True';
}
);
This monitors each input, select and textarea tag on the form for changes. Unfortunately, the nature of CKEditor prevents me from being able to monitor an instance for changes.
In reading the FCKEditor documentation, I found mention of an isDirty method. But I cannot fine a similar method for CKEditor.
Nuts and bolts: How can I monitor a CKEditor instance for user-generated changes?
$("input, select, textarea)
.change(function() {
isDirty = 'True';
}
);
This monitors each input, select and textarea tag on the form for changes. Unfortunately, the nature of CKEditor prevents me from being able to monitor an instance for changes.
In reading the FCKEditor documentation, I found mention of an isDirty method. But I cannot fine a similar method for CKEditor.
Nuts and bolts: How can I monitor a CKEditor instance for user-generated changes?
Re: Monitor CKEditor instance for changes
Re: Monitor CKEditor instance for changes
Re: Monitor CKEditor instance for changes
Re: Monitor CKEditor instance for changes
Thanks
Reg
Re: Monitor CKEditor instance for changes
Reg, you even made up a proper name for the function and did not bother to actually look it up?
See checkDirty() in CKEditor API documentation.
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: Monitor CKEditor instance for changes
I spent quite a bit of time searching actually, and couldn't find it. All that came up in the results were references to FCKEditor 2. Don't know what I was doing wrong. Thanks for setting me on the right path.
If I understand correctly, this function will return whether a change has been made whenever you ask for it. What I am looking for is something that will call a function whenever a change is made (or when CKEditor loses focus and a change has been made) so that I can show the Save button on the page.
On other, non-CKEditor, fields I can bind an onchange event to turn on the Save button. Is it possible to do something like that with a CKEditor control?
Thanks
Reg
Re: Monitor CKEditor instance for changes
I think what I need to use is the "blur" event, but I am having trouble getting the syntax correct. Anyone suggest the correct way of doing this please?
I have tried other variations (using the name of the dom element being repalced alone or with the CKEDitor keyword) and nothing seems to work. So I am lost. Any help would be greatly appreciated.
Thanks
Reg
Re: Monitor CKEditor instance for changes
Re: Monitor CKEditor instance for changes
What I have worked out is the following:
It seems to work; when I leave one of the CKEditor instances and a change has been made to that control, the save button is displayed (that's what happens in the TrackDirty function).
My question is, is this the best way of doing it or have I produced a kludge?
Thanks,
Reg
Re: Monitor CKEditor instance for changes
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: Monitor CKEditor instance for changes
Reg
Re: Monitor CKEditor instance for changes
Here's a full plugin that fires a "change" event whenever the content of an instance changes: http://alfonsoml.blogspot.com/2011/03/o ... ditor.html