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 change() event that i'm currently using in the jsfiddle example below, but thats not the same as keyup. I want the div to be updated as i'm typing in. I tried keyup but it doesn't work.
Here's what i have now
$("#input").cleditor().change(function(){
var v = $('#input').val();
$('#x').html(v);
})
Check jsfiddle http://jsfiddle.net/qm4G6/11/
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
Modified to
and in the options that are passed at the time of initialisation, you can define
Hope this helps anyone.
Regards
Have you tried using of CLEditor '.doc' property?
It appears that
cleditor
hides thetextarea
and replaces it with aniframe
(see line 203 of cleditor source).So to achieve what you want, you just need to access the resulting
iframe
contents:Updated jsFiddle
UPDATE to address Tim's comment
This works in Chrome and Firefox (I don't have access to IE):
Updated jsFiddle
UPDATE 2
User ima007 was able to find a better cross-browser solution: jQuery Cleditor wysiwyg text editor: keyup() works in webkit browsers but not Firefox or IE