Content ckeditor in textarea on change event - beginner

I am trying to enter the contents of my ckeditor in the corresponding text box as the user enters a value in ckeditor.

I read several useful topics, namely here and here , but I gather in circles as my experience and knowledge in the code are not so great.

I understand how ckeditor works, and that I should use a change event, as described in the post.

I was able to add the following jquery code to display a warning message when a user enters a value in ckeditor:

for (var i in CKEDITOR.instances) { CKEDITOR.instances[i].on('change', function() {alert('value changed!!')}); } 

My text area code:

 <textarea id="id_a_description" rows="10" cols="40" name="a_description" class="input-95pc" style="visibility: hidden; display: none;"></textarea> 

How to change the jquery code above to enter a value from ckeditor into the text area when users use the ckeditor change event?

It would really help me, since I'm so upset that I could not solve this problem even though I think I am very close to the solution.

+2
jquery ckeditor
source share
1 answer

Try calling this function in the onchange event

 CKEDITOR.instances[i].updateElement(); 
+4
source share

All Articles