pass popup form value to main window

  • Thread starter William Starr Moake
  • Start date
W

William Starr Moake

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.
 
C

Csaba Gabor

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.generatedTableContents =
document.getElementById('myTable').innerHTML

HTH
Csaba Gabor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top