Fckeditor doesn’t want to focus in Firefox? Solution
FCKEditor is a nice free WYSIWYG editor, highly customizable. Occasionally, however, especially when used with a div that shows/hides or JavaScript doesn’t want to focus properly in Firefox. Here’s a way I found around about it.
function wakeUpFireFoxFckeditor()
{
var oEditor = FCKeditorAPI.GetInstance(‘myinstanceoffckeditor’) ;
try
{
oEditor.MakeEditable();
}
catch (e) {}
oEditor.Focus();
}
Just to add:
- It’s best to call FCKeditorAPI – in fact you’d get an error if you did – after the page is loaded. Hence it’s in a function. You could probably tie it to a body onload, or onclick=”", etc.
- Use the try/catch approach. IE complains that you are waking up Firefox, so this is just a way to gracefully make both of them happy.
- Focus for usability. More commands available at: http://wiki.fckeditor.net/Developer%27s_Guide/Javascript_API

Richard Binnington
You are the man! That worked like a charm! Thank you :>
Richard
Anonymous
Hi there,
sorry but this does not seem to work for me. I only allows me to edit or focus after I unhide the div section and then hit REFRESH the page =(
Weird.. I’ve got the latest FCK version and running on FF version 2.0
Anonymous
Thank you for this post! It saved me!
Michael
Afnan
great, seems working for me.
previously i was doing …
oEditor.SetHTML(oEditor.GetXHTML( true ));
A French Developper
Thank You very much, I was having trouble about this and I really didn’t know what to do !