tinyMCE blur event

T1000 picture T1000 · Apr 8, 2011 · Viewed 19.4k times · Source

Hello I want to do some stuff when user finished writing in the tinyMCE textarea and click somewhere outside (onBlur). So far I haver try:

$('#id_topic_text_parent').live('blur',function(){
    alert('asd')
//I saw #id_topic_text_parent in firebug, it is span containing the tiny mce
});

also

$('#id_topic_title').blur(*and*)live('blur...
tinyMCE.activeEditor.blur(*and*)live('blur...

But it wont work.
Can you assist me.

Answer

ptguy picture ptguy · Jun 4, 2014

according to http://www.tinymce.com/wiki.php/api4:event.tinymce.Editor.blur

This works for me

setup : function(ed) {
    ed.on('blur', function(e) {
        alert('blur');
    });
},