I\'m using Cleditor http://premiumsoftware.net/cleditor/docs/GettingStarted.html. I want to get the value on keyup and insert the text into another div. cleditor comes with chan
I was able to achieve this by slightly modifying the source code of the editor -
in refresh
method (line 801) I modified the blur event handler of iframe doc.
Previous
// Update the textarea when the iframe loses focus
($.browser.mozilla ? $doc : $(contentWindow)).blur(function() {
updateTextArea(editor, true);
});
Modified to
// Update the textarea when the iframe loses focus or keyup happens
($.browser.mozilla ? $doc : $(contentWindow)).bind('blur keyup', function (e) {
updateTextArea(editor, true);
if (options.keyup && e.type === 'keyup')
options.keyup(editor.$area.val());
});
and in the options that are passed at the time of initialisation, you can define
$("#element").cleditor({
keyup : function (text) {
alert(text);
// do something
}
});
Hope this helps anyone.
Regards