Re: Error in Editor1.GetDocument() function when called in javascript on aspx page

  •  05-02-2006, 2:47 AM

    Re: Error in Editor1.GetDocument() function when called in javascript on aspx page

    Hi,
     
    Here is my aspx code of popup window where i want to use cute editor content i.e (parent window).
     
     
    ---------------******************----------Code goes here------------------------------------**************************
     
    <%@ Page language="c#" Codebehind="SpellingForm.aspx.cs" AutoEventWireup="false" Inherits="CS_Example2.SpellingForm" %>
    <%@ Reference Page="OpenXEditor.aspx"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
     <HEAD>
      <title>SpellingForm</title>
      <SCRIPT LANGUAGE="JavaScript">
    // Copy the selected suggestion to the Change To field
    function onSuggestionChange() {
     var i = document.SpellingForm.SuggestionsLst.selectedIndex;
     document.SpellingForm.ChangeToTxt.value = document.SpellingForm.SuggestionsLst.optionsIdea [I].text;
    }
      function getEditorText()
      {
       debugger;
      
       alert("Hello");
        var editor1 = window.opener.document.forms[0].elements['PowerXEditor1:Editor1'];
       alert('Sunder');
       var editdoc = editor1.GetDocument();
       //alert(editdoc.body.innerHTML);
       var mystr = new String(editdoc.body.innerHTML);
       alert(mystr);
      }
      </SCRIPT>
      <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
      <meta name="CODE_LANGUAGE" Content="C#">
      <meta name="vs_defaultClientScript" content="JavaScript">
      <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
     </HEAD>
     <body onload="getEditorText();">
      <form id="SpellingForm" method="post" runat="server">
       <P>
       </P>
       <BR>
       <P></P>
       <HR width="100%" SIZE="1">
       <P align="center">
        <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="50%" bgColor="#ffffcc" border="0">
         <TR>
          <TD>
           <DIV align="center">
            <TABLE id="Table2" cellSpacing="1" cellPadding="1" width="80%" align="center" border="0">
             <TR>
              <TD>
               <asp:label id="ProblemDescriptionLbl" runat="server" Width="209px"></asp:label></TD>
              <TD>
               <asp:label id="ProblemWordLbl" runat="server" Width="289"></asp:label></TD>
             </TR>
             <TR>
              <TD>
               <asp:label id="Label1" runat="server" Width="209">Change to:</asp:label></TD>
              <TD>
               <asp:textbox id="ChangeToTxt" runat="server" Width="290"></asp:textbox></TD>
             </TR>
             <TR>
              <TD>
               <asp:label id="Label2" runat="server" Width="209">Suggestions:</asp:label></TD>
              <TD>
               <asp:listbox id="SuggestionsLst" runat="server" Width="290px" Height="110px"></asp:listbox></TD>
             </TR>
             <TR>
              <TD align="middle" colSpan="2">
               <TABLE id="Table3" cellSpacing="1" cellPadding="1" width="50%" border="0">
                <TR>
                 <TD>
                  <asp:button id="IgnoreBtn" runat="server" Width="97px" Text="Ignore"></asp:button></TD>
                 <TD>
                  <asp:button id="ChangeBtn" runat="server" Width="97px" Text="Replace"></asp:button></TD>
                 <TD>
                  <asp:button id="AddBtn" runat="server" Width="97px" Text="Add"></asp:button></TD>
                </TR>
                <TR>
                 <TD>
                  <asp:button id="IgnoreAllBtn" runat="server" Width="97px" Text="Ignore All"></asp:button></TD>
                 <TD>
                  <asp:button id="ChangeAllBtn" runat="server" Width="97" Text="Replace All"></asp:button></TD>
                 <TD>
                  <asp:button id="CloseBtn" runat="server" Width="97px" Text="Cancel"></asp:button></TD>
                </TR>
               </TABLE>
              </TD>
             </TR>
             <TR>
              <TD align="left" colSpan="2">
               <DIV style="DISPLAY: inline; WIDTH: 70px; HEIGHT: 15px" align="left" ms_positioning="FlowLayout">
                <P align="center"><EM><FONT size="2">Context:</FONT></EM></P>
               </DIV>
               <asp:label id="ContextLbl" runat="server" Width="532px" Height="68px" BorderWidth="1px" BorderStyle="Solid" Font-Size="X-Small"></asp:label></TD>
             </TR>
            </TABLE>
           </DIV>
          </TD>
         </TR>
        </TABLE>
       </P>
      </form>
      <P><HR WIDTH="100%" SIZE="1">
     </body>
    </HTML>
    ---------------******************----------End for Code ------------------------------------**************************
     
     
View Complete Thread