Re: How to get color code of body which set in Page Property dialog

  •  11-08-2011, 7:09 AM

    Re: How to get color code of body which set in Page Property dialog

    Hi WilliamK,
     
    I think you are using the classic asp version, please try the example below. It shows you how to get the border property of the editor body.
     
    <!-- #include file = "cuteeditor_files/include_CuteEditor.asp" -->
    <html>    
        <head>
            <title>ASP Editor Demo</title>
        
        </head>
        <body>
        <form name="theForm" method="post">
         <%   
           Dim editor   
           Set editor = New CuteEditor   
           editor.ID = "Editor1"  
           editor.Text = "Hello World"  
           editor.EditCompleteDocument=true
           editor.Draw()   
        %>
           <br />     <input type="button" value="Get border property of editor content" onclick="getBorder()" />
                            
        </form>
        </body>
    </html>
    <script>
    function CuteEditor_OnInitialized(editor)
    {
        var editor1 = document.getElementById('CE_Editor1_ID');
        var editdoc = editor1.GetDocument();
        //set border when editor load
        editdoc.body.style.border="solid 1px red";
    }
    function getBorder()
    {
       var editor1 = document.getElementById('CE_Editor1_ID');
       var editdoc = editor1.GetDocument();
       //get border
       alert(editdoc.body.style.border);
    }
    </script>
     
    Regards,
     
    Ken
View Complete Thread