469,623 Members | 1,535 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

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.
Jul 23 '05 #1
1 2392
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

"William Starr Moake" <ws*****@yahoo.com> wrote in message
news:95********************************@4ax.com...
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.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Peter Kirk | last post: by
1 post views Thread by TErnst | last post: by
3 posts views Thread by Alex | last post: by
2 posts views Thread by jackson2005 | last post: by
1 post views Thread by colleen1980 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.