pass popup form value to main window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William Starr Moake

    pass popup form value to main window

    The browser-based WYSIWYG editor I'm developing has a popup window
    with a form that generates table code from user input (width, border,
    cols, rows, bgcolor.) But the user has to copy-paste the generated
    table HTML into the editor window as it works now. How do I pass the
    form-generated HTML directly to the editor window so copy-paste is not
    necessary? I know I have to set focus on the editor window in the
    generate table code function, but I don't understand how to use
    javascript opener to pass generated code.

    Do I have to create the popup window from within the main window HTML
    or can I leave it as an external popup opened by the ordinary
    javascript method? The editor is strictly for offline use, so
    server-side scripts are not the answer.
  • Csaba Gabor

    #2
    Re: pass popup form value to main window

    I think what you're looking for is window.opener
    That way that popup window can pass back pretty much
    whatever it likes to the original window that created it:
    For example:

    window.opener.g eneratedTableCo ntents =
    document.getEle mentById('myTab le').innerHTML

    HTH
    Csaba Gabor

    "William Starr Moake" <wsmoake@yahoo. com> wrote in message
    news:95o290h88d 0dmvp3gu9q03vmn h8r8nfo2a@4ax.c om...[color=blue]
    > The browser-based WYSIWYG editor I'm developing has a popup window
    > with a form that generates table code from user input (width, border,
    > cols, rows, bgcolor.) But the user has to copy-paste the generated
    > table HTML into the editor window as it works now. How do I pass the
    > form-generated HTML directly to the editor window so copy-paste is not
    > necessary? I know I have to set focus on the editor window in the
    > generate table code function, but I don't understand how to use
    > javascript opener to pass generated code.
    >
    > Do I have to create the popup window from within the main window HTML
    > or can I leave it as an external popup opened by the ordinary
    > javascript method? The editor is strictly for offline use, so
    > server-side scripts are not the answer.[/color]


    Comment

    Working...