Re: Getting the content

  •  03-03-2005, 9:28 AM

    Re: Getting the content

    Access Cute Editor Text from client side javascript.

    1. Code:

    // get the editor client ID
    var editor1=document.getElementById('<%=Editor1.ClientID%>');
     
    //Get the editor content 
    var editdoc=editor1.GetDocument();

    // Get the editor innerHTML
    alert(editor.innerHTML);

    //Get the editor InnerText
    alert(editor.InnerText);

    //Set the editor innerHTML
    editdoc.body.innerHTML="your innerHTML here";

    //Set the editor InnerText
    editdoc.body.InnerText= "your innerText here";
     
    2: Live demo:
     
     
    The dad.html will open a pop-up (kid.aspx) window with CuteEditor in it.

    In kid.aspx, you can find the following two javaScript fucntions:

     //Get the editor innerHTML and set the dad.html field value
    function tellDad()
    {
     var editor1=document.getElementById('CE_Editor1_ID'); 
     var editdoc = editor1.GetDocument(); 
     v_parentform.elements[v_field].value=editdoc.body.innerHTML;
    }

     //Get the dad.html field value and set the editor innerHTML
    function getparentdata()

     var editor1=document.getElementById('CE_Editor1_ID'); 
     var editdoc = editor1.GetDocument(); 
     editdoc.body.innerHTML = v_parentform.elements[v_field].value;
    }
     
    Hope it helps.
     
     

    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 Complete Thread