Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLEditor dynamic adding text

Tags:

jquery

I'm using CLEditor for a website I'm working on. I'm trying to add dynamic text to the textarea with jQuery. Usually I'll be using something like:

$('#myText').val('Here some dynamic text');

But this just doesn't work with CLEditor. When disabling CLEditor it works fine however, enabling it again the text just disappears. I tried looking on the website for a solution, but I can't find any. Anyone had the same problem lately?

Thanks in advance.

like image 722
moonwalker Avatar asked Feb 23 '11 15:02

moonwalker


1 Answers

CLEditor update iFrame content when blur method of textarea is called:

//make CLEditor
$(document).ready(function() {
  $('#text').cleditor();
});

//set value
$('#text').val('new text data').blur();
like image 199
verybadbug Avatar answered Oct 03 '22 12:10

verybadbug