Retrieve the content of FCKEditor

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().


MyQuotes Screenshot

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds. Valid XHTML and CSS.