Passing Data To/From Popup Window

The time may come when you want to open up some sort of popup window, pass data into it, and pass data out of it back to the window opener. This task can be accomplished in three easy steps.

First, make a ghost form that will be used to pass data into the popup.

<form name=ghost method=post target="the_target_window" action="/the/destination.php">
<input type=hidden name="data" value="">

Mix in a little JavaScript.

function submit_form()
{ = document.other_form.text_area.value;
    TgtWindow ='', 'the_target_window', 'attributes=go_here');

Now you can use window.opener to get back to the parent. Set whatever data you want, like the JavaScript example I have below. I used it when I pressed a "Save" style of button to send the reformatted text back to the original form.

window.opener.document.other_form.text_area.value = "altered state";
If there are only 3 colors, 10 digits, and 7 notes; it's what we do with them that's important. Tyler Akins <>
Contact Me - Legal Info