SetHTML not a function

Last post 08-02-2011, 8:17 AM by Kenneth. 7 replies.
Sort Posts: Previous Next
  •  02-04-2011, 10:37 AM 66056

    SetHTML not a function

    Has anyone ever had a problem with the editor not being recognized when you try to get it via javascript.  Here is my code,
     
    var editor1 = document.getElementById('<%=texteditor.ClientID%>');
    editor1.SetHTML(document.getElementById(fieldname).value);
     
    When I do an alert of the editor1 variable I get an HTMLTableObject, is this correct?  Whenever I try to access the element I get an error saying the editor function doesn't exist, like it's not recogonizing it as a cute editor object.    The editor is in a modal popup, if I take it out of the modal popup everything works fine.  Has anyone ever seen this before?
  •  02-04-2011, 10:47 AM 66058 in reply to 66056

    Re: SetHTML not a function

    Dear AWG,
     
    I advise you refer to http://cutesoft.net/example/JavaScript-API.aspx , this example demonstrates how to use SetHTML, you can find this example's source code in download package.
     
    If you need further help, you can post your code here, I will have a test of your code on my end.
     
    Thank you for asking
  •  02-04-2011, 12:55 PM 66065 in reply to 66056

    Re: SetHTML not a function

    Can you try the following code?
     
    // retrieving the content of Cute Editor as HTML
    var content = editor1.getHTML();
    alert(content );
    Are you able to get the content of editor?
     
    If not, can you check the html source of the page which contains Cute Editor? Maybe the client ID of the editor is not correct. Keep me posted
     
    <table cellspacing="0" cellpadding="0" _IsCuteEditor="True" id="CE_Editor1_ID" ..>


    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

  •  02-04-2011, 1:48 PM 66072 in reply to 66065

    Re: SetHTML not a function

    Yea I tried to output the content and it has the information that I want.  Also I checked the ID and it is def the correct ID, for some reason it's not recognizing that the table is a CuteEditor Object, thus not allowing me to use the api funcitons.
  •  02-07-2011, 11:56 AM 66100 in reply to 66056

    Re: SetHTML not a function

    Ok I found out a little more about my problem.  This issue on happens the first time I load the modal window.  If i close the window and then open it back up the editor loads with the desired text.  Does this help at all?
     
    Thanks,
    AWG
  •  02-09-2011, 2:21 PM 66145 in reply to 66100

    Re: SetHTML not a function

    I am having the same problem accessing the SetHTML and GetHTML when the editor is on a hidden TabPanel after a postback.
    I can populate the editor in my codebehind, but cannot access on the client end with SetHTML or GetHTML.
     
    This is starting to be a deal breaker for us.  We are still working on other options.  I really like this editor and do not want to research another one, but may need to if there is not a workaround for this problem.
     
    Is there another way to access the text?

    The Analytical Group
  •  08-02-2011, 1:10 AM 69149 in reply to 66145

    Re: SetHTML not a function

    ya...i am also facing same problem of setHTML(), It gives javascript error.
  •  08-02-2011, 8:17 AM 69167 in reply to 69149

    Re: SetHTML not a function

    Hi Akhi1978,
     
    Can not use the Editor API belore CuteEditor load completely.
     
    Can you show me your code? So we can check it for you.
     
    Regards,
     
    ken
View as RSS news feed in XML