You need to be logged in to post in the forum - Log In
An active JCE Pro Subscription is required to post in the forum - Buy a Subscription
- Support
- Forum
- MediaBox
- JCE Editor
- Detect change in editor textarea with jQuery
Hi,
I would need to detect the change in JCE textarea in my script using jQuery, but I'm not able to do this. When trying to detect the textarea I used:
It detects the click on editor toolbars, but not in textarea itself which seems to be inside iframe. But also this doesn't work:
My goals is to call a function when there is a change detected in any of the JCE textarea's on my form.
What am I missing?
Thanks!
I would need to detect the change in JCE textarea in my script using jQuery, but I'm not able to do this. When trying to detect the textarea I used:
jQuery("body").on("click", function(e) {
console.log(e.target);
});
It detects the click on editor toolbars, but not in textarea itself which seems to be inside iframe. But also this doesn't work:
jQuery("iframe").load(function(){
jQuery(this).contents().on("mousedown, mouseup, click", function(){
alert("Click detected inside iframe.");
});
});
My goals is to call a function when there is a change detected in any of the JCE textarea's on my form.
What am I missing?
Thanks!
The textarea is only updated when the editor content is saved, so you need to use the editor API to detect changes in the editor content before saving, ie: while creating content.
You can't do this with jQuery, but this might help:
You can't do this with jQuery, but this might help:
(function () {
tinyMCE.onAddEditor.add(function (mgr, ed) {
ed.onPreInit.add(function () {
ed.onChange.add(function () {
console.log('content changed');
});
});
});
})();
Just because you're not paranoid doesn't mean everybody isn't out to get you.
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!