Loading the contents of a rich text popup with client side javascript

  •  05-09-2005, 1:48 AM

    Loading the contents of a rich text popup with client side javascript

    I have a page with multiple rich text fields and on slower computers it is quite slow opening.
     
    I am trying to work out a way of having div fields to display the contents of the field and a button above the field that opens a popup containing a rich edit control that reads the contents of the div field, allows the user to edit the data, then save the contents back to the div when they click save.
     
    I am having trouble with the javascript in the popup that reads the contents of the div.
     
    I user the following code:
     
    var editor1 = document.getElementById('<%=RichEdit.ClientID%>');
    var editdoc = editor1.GetDocument();
    editdoc.body.innerHTML = window.opener.document.getElementById('<% =Request.QueryString["f"] %>').innerHTML;
     
    That is run in  the onload event. But the editor1.GetDocument does not always exist when the onload event fires.
     
    Is there an event that can be raised when the editor has finished loading?
     
    Does someone have an example of some similar functionality?
View Complete Thread