Can not call getHTML() with Cute Editor in "hidden" divs

Last post 07-10-2008, 8:32 PM by beckie. 2 replies.
Sort Posts: Previous Next
  •  07-05-2008, 1:05 PM 41961

    Can not call getHTML() with Cute Editor in "hidden" divs

    I have two Cute Editors.  Each one is in its own separate DIV.
     
    One is in a DIV with a style attribute of “display:block” and the other is in a DIV with a style attribute of “display:none”.  

    I am having trouble with the editor that is in "display:none" DIV.  When I call the method editor1.getHTML() in FireFox, I get an error "editor1.getHTML is not a function". 
     
    This happens in both FireFox and Safari but it works fine in IE 7.

    In IE, the function works fine for both editors, whether in a DIV with “display:none” or in the DIV with the “display:block”.

    How can I get the editor functions to work in a DIV that is styled display:none for ALL browsers?
     
    My version of Cute Editor is 6.1
     
    Thanks,
    Becky
  •  07-09-2008, 10:04 AM 42058 in reply to 41961

    Re: Can not call getHTML() with Cute Editor in "hidden" divs

    Hi Becky
     
    I had this problem once. It is caused because the Editor is not initialized until it is made visible:
    The last line of the Editor generated code says something like this:

    <img src="http://cutesoft.net/iqbox_admin/CuteSoft_Client/CuteEditor/images/1x1.gif?633512184283906250" onload="CuteEditorInitialize('CE_Editor_ID', blah, blah, blah ") />

    So when that final image is loaded the Editor initializes ... Firefox does not load the images until the div is made visible. The only way I can see to get around this is a bit of a hack but it should work.

    Just copy the onload event from this image and call it on page load:
    CuteEditorInitialize('CE_Editor_ID', blah, blah, blah);

    Now you should be able to use editor1.getHTML() without problems ... unless, of course, the editor has previously been visible and is hidden again ... I remember coming accross that problem too.

    Good luck,

    Fred
  •  07-10-2008, 8:32 PM 42124 in reply to 42058

    Re: Can not call getHTML() with Cute Editor in "hidden" divs

    Hi Fred,
     
    Thanks for the response and the code.  It is much appreciated.  I will give it a try.
     
    Cheers,
    Becky
View as RSS news feed in XML