Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Communicating with popup windows.

Status
Not open for further replies.

Markh51

Programmer
May 20, 2003
81
GB
How do I "communicate" with a popup window which was opened by another one of my forms ?

The reason why I ask is that a user complete's a form then hit's submit, on this form a popup window is launched and then it is self submitted, to another form. The only problem I am having is having the last form "write" to the popup window (is this because this form did not open it ??)

Any ideas on how to get arounf this problem ??

Cheers,
mark
 
BTW,

This is the script I am using to modify the contents of the popup window. Can you modify it so it will work for my situation:

<script language=&quot;JavaScript&quot;>
if (waitWindow && !waitWindow.closed)
{
var statusTxt ='SOME TEXT';
waitWindow.document.open();
waitWindow.document.write(statusTxt);
waitWindow.document.close();
}
</script>

Thanks,
Mark
 
Ok, but the posting action submits the form - refreshing the window. That's why you lose the window handle.

What you will need to do is set up a polling routine in the popup window (it will retain a handle to it's opener) which checks the value returned by whatever process verifies your file upload.
 
and how do I set up a &quot;polling routine&quot; ??

Regards,
Mark
 
[ul]
[li]Write a function that will check a variable in the opening window, ie: [tt]if(window.opener.myVariableName == &quot;myTestValue&quot;)[/tt][/li]
[li]If that test returns true, display the OK status message[/li]
[li]If not, use the setTimeOut function to call your function again after a short delay[/li][/ul]

You're getting into some pretty heavy programming territory for a self-proclaimed newbie. Perhaps a short stint with some JavaScript references might help you crawl before you walk.

 
nope, you've lost me (again)

Sorry, you need to explain in more detail, where I shoul put the code.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top