Retrieve the content of FCKEditor
Posted by mkhairul - September 10, 2008 at 10:09:28 am -Categories: Tips, code
Here’s an interesting problem that I faced few days ago on MyQuotes. I wanted to apply a lightbox kind of preview for the content the user put in. I use FCKEditor for the textarea. I have no idea how to retrieve the contents from the textarea (to put it into the lightbox).
After googling around ( I forgot the keyword that I used ), I found it, it can be retrieved using FCKEditor’s API.
oEditor = FCKeditorAPI.GetInstance('quote');
myValue = oEditor.GetXHTML(oEditor.FormatOutput);
The FCKEditor is using BBCode, to minimize abuse (hope it works! LOL). Since I don’t know how to convert the bbcode values retrieved from the content into HTML tags, I use the next best thing. Send it to be converted and tagged up using jQuery’s $.post().
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds.
Valid XHTML and CSS.

