Re: Insert Text

  •  08-26-2004, 6:08 PM

    Re: Insert Text

    Ok, I had that working within the same window, but if I open a new window, how do I access the Editor object within the parent window from the opened window?

     
    For example, I created a wrapper function for insertHTML where I pass Editor1 as the Editor object. My function is defined as follows (this is all Javascript, not VBScript):
     
    function insert_content(current, content) {
        insertHTML(current.EditorID, content);
    }
     
    Within that page, I can call the function within a link to insert text at the current cursor position as follows:
     
    <a href=insert_content(Editor1, 'Sample Text');">Insert Sample Text </a>
     
    I can call the function from a popup window as follows:
     
    window.opener.insert_content(window.opener.document.Editor1, 'Sample Text');
     
    However, I get a Javascript error that Editor1 is null or not an object. I think the window.opener.document.Editor1 is wrong, but what should I put there?
     
    window.opener.insert_content(Editor1, 'Sample Text'); doesn't work either, as I would expect it wouldn't, since it is calling the function (and referencing the Editor1 object) on the main window from the popup window.
     
    This is CuteEditor for ASP version 2.2
     
    Any help would save me a bundle of trial and error time, although I am not sure what to try next.
     
    Many thanks in advance!
     
     
     
     
View Complete Thread