Hello Everyone,
i generate ckeditors dynamically in jquery as this: first i create a new div and then in that new div i generate new ckeditor whenever add button is clicked.
$('#add').click(function(){
$('<div class = "editors name="dynamic[]"><div class="field" cols="20" id="'+id+'" name="dynamic[]" rows="10"></div><div>').appendTo('.inputs');
$('.field:last').ckeditor(config);
}
But
I have just this one question that how can i apply onchange function to these dynamically generated ckeditor in jquery.
I have done it in javascript as this
CKEDITOR.on('instanceCreated', function (e) {
e.editor.on('change', function (ev) {
var temp = ev.editor.getData();
alert(temp);
}); });
i generate ckeditors dynamically in jquery as this: first i create a new div and then in that new div i generate new ckeditor whenever add button is clicked.
$('#add').click(function(){
$('<div class = "editors name="dynamic[]"><div class="field" cols="20" id="'+id+'" name="dynamic[]" rows="10"></div><div>').appendTo('.inputs');
$('.field:last').ckeditor(config);
}
But
I have just this one question that how can i apply onchange function to these dynamically generated ckeditor in jquery.
I have done it in javascript as this
CKEDITOR.on('instanceCreated', function (e) {
e.editor.on('change', function (ev) {
var temp = ev.editor.getData();
alert(temp);
}); });