Hidden Input Elements in Firefox

Posted by splatto on Stack Overflow See other posts from Stack Overflow or by splatto
Published on 2009-08-03T21:02:45Z Indexed on 2010/03/26 13:53 UTC
Read the original article Hit count: 274

I'm having troubles with fckeditor in Firefox. When the user goes to a page, the html (encoded) is stored in a hidden input element. I call the predefined fckeditor javascript event to populate my editor with the html from the hidden ContentBody element.

        function FCKeditor_OnComplete( editorInstance )
        {
            editorInstance.InsertHtml("");
            var sample = document.getElementById("ContentBody").value;
            editorInstance.InsertHtml(sample);
        }

This automatically populates the editor with the desired text in IE, but in Firefox it doesn't. Firebug gives me the error :

A is null [Break on this error] var FCKW3CRange=function(A){this._Docume...eateFromRange(this._Document,this);}};\r\n

Using Firebug I can determine that the event method FCKeditor_OnComplete() just isn't fired when using Firefox. It is, however, in IE. Any ideas on how to get this to work in both browsers?

The HTML for ContentBody is: <input type="hidden" name="ContentBody" id="ContentBody" value="<%=Model.Article%>" />

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about fckeditor