Click to See Complete Forum and Search --> : Help With Processing Parent and Child Windows


ejrhodes
05-05-2003, 08:39 PM
Guys,
I am new to Javascript so any help you could provide would be appreciated. Basically, I am implenting an impersonation module in a system I am developing.

In the parent window, I want to call an asp page to complete the impersonation, then pop-up a child window automatically that calls the impersonation logout asp form, and refresh the parent window. The first and last part can be done in ASP but how do I automatically pop up a window once the page loads?

Once I click the logout button in the child window, i want to process an ASP page to reset the credentials, refresh the parent window once the child window is done processing, and close the child window. Can I control the parent window from the child?

This is important for a presentation I am doing this week so any help will be appreciated. I could do everything in ASP and not use pop-ups, but the preference is a pop-up box. Thanks

Jona
05-05-2003, 08:54 PM
To open a window onload:

<body onload="window.open('file.asp','the_child_name');">

To control the parent window from the child:

<body onunload="parent.forms['formName'].submit();">

The above onunload will submit a form in the parent window.

ejrhodes
05-05-2003, 09:33 PM
Originally posted by Jona
To open a window onload:

<body onload="window.open('file.asp','the_child_name');">

To control the parent window from the child:

<body onunload="parent.forms['formName'].submit();">

The above onunload will submit a form in the parent window.

Does the unload launch the action after the child is closed? How would I refresh the body of the parent and close the child? I think I am getting the hang of this, time to play around with this when i get to work tomorrow :)

Jona
05-05-2003, 09:50 PM
In the child window:

parent.document.reload(); self.close();

Jona
05-05-2003, 09:51 PM
Oops, forgot to put in the parent window. :p

For the parent window:

document.reload(); the_child_name.close();