//Wednesday 18 June 2008

Get the FCKEditor value from javascript

As a postscript to my previous post about customizing the Subsonic Scaffold I also had cause whilst building an admin interface to pull out the XHTML value from the editor in a Javascript function. This took a little bit of searching for so I thought I would post it here:

FCKeditorAPI.GetInstance("ctl00_phAdmin_Scaffold1_PageContent").GetXHTML(true);

Where ctl00_phAdmin_Scaffold1_PageContent is the ID of your FCKEditor control.

I found the answer here:

http://www.fckeditor.net/forums/viewtopic.php?f=6&t=9536&start=0&st=0&sk=t&sd=a

I guess I should have gone straight to the Javascript API docs but I tend to just Google questions like this. Since my first search was the title of this post hopefully this will help people to find the answer quicker than I did.

No comments:

SyntaxHighlighter