calebbee — 2013-01-12T20:36:01-05:00 — #1
Hey guys, i'm trying to use CKEditor for people to enter text in and ill use the text to put it in a database and show them what they typed. How would i do this with Jquery? I know that using the .getData() gets you the text, but i want to take that text and append it to a <p> tag so that the user can see what they typed. Also, how could it be made to update on the .keyup function?
I have the code to make it show up in the <p> tag:
var editor = CKEDITOR.replace('editor');
var editor_data = editor.getData();
but i can't seem to make it update at all. What could be a good solution for this?
pullo — 2013-01-13T09:17:24-05:00 — #2
Could you post a link to a demo page that includes the CKEditor?
That way I can play around with it and try and help you solve your problem.
calebbee — 2013-01-13T09:41:23-05:00 — #3
pullo — 2013-01-13T14:50:17-05:00 — #4
It turns out that there's no default event fired whenever something changes in CKEditor, but it's possible to extend the CKEditor API and add this functionality.
Here's a blog post with a working demo that does what you want: http://alfonsoml.blogspot.com.es/2012/05/recipe-live-preview-of-ckeditor.html
Hope that helps.
Let me know if you run into any trouble.
calebbee — 2013-01-13T17:34:11-05:00 — #5