Is setHTML() supported in v5.2

Last post 07-31-2008, 8:16 AM by Adam. 1 replies.
Sort Posts: Previous Next
  •  07-31-2008, 6:42 AM 42646

    Is setHTML() supported in v5.2

    Is setHTML supported in v 5.2? I ask because no matter what I try I cannot get it to work. Whenever I do I get a "Object doesn't support this property or method" error in IE and "editor1.setHTML is not a function" in FF. In fact I get the same errors if I use the getHTML function too, though if I use alert(editor1.value) this returns the current content of the editor window, so I know the ID I'm using for the editor appears to be correct.
     
    The asp code used to insert the editor in the page is:
     
    <%
    Dim InitialContent
    InitialContent = "<p>Please enter some text.</p>"
    Dim editor
    Set editor = New CuteEditor
    with editor        
        .ID = "CEdit1"
        .ThemeType = "OfficeXP"
        .Text = InitialContent
        .FilesPath = "../CuteEditor_Files"
        .AutoConfigure = "LinkPage"
        .Width = "100%"
        .Height = 300
        .EditorBodyStyle = "table { font:normal 12px arial; }"
        .EditorWysiwygModeCss = "/include/CuteEditor.css"
        .BreakElement = "p"
        .Draw()
    end with
    %>

    The javascript function I'm using to try to populate the editor is:
     
    function setText(theHTML) {
        var editor1 = document.getElementById("CEdit1");
        editor1.setHTML(theHTML);
    }

    setText(theHTML) is called from an ajax function that does a database lookup when a user clicks a link and passes over the results in theHTML - this has been tested and is working correctly.

    Please help before I go mad!
     
    Thanks,
     
    Pete
  •  07-31-2008, 8:16 AM 42651 in reply to 42646

    Re: Is setHTML() supported in v5.2

    Pete,

    1. setHTML is supported in version 5.2.
     
    2. Try change

    var editor1 = document.getElementById("CEdit1");
     
    to
     
    var editor1 = document.getElementById("CEdit1_editBox");

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML