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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Pop up Window 1

Status
Not open for further replies.

cheekykevwalker

Programmer
Sep 17, 2003
6
GB
This might be simple but I'm pretty new to this so not sure!I have used some Javascript within a button on an aspx page to launch a pop-up window to confirm that details have been added to a database. The window has a close button on it. I wish for when the close button (within the popup window) is pressed the window to close and the ORIGINAL browser or parent window to be redirected to a new page on this event. When I have tried this all I can get to happen is the new page appear in the tiny Javascript pop up window I have cretaed, wheras I want the window to close (when the close button is pressed) and the browser window behind to be redirected to a new page. I'm stuck with this :eek:( Can anyone help ????? I will mail code if needed I just need an example to work to??? Cheers Kev
 
cheek: have you tried sizing the window? For example:

function openWinSite(){
var str4Page;
var strCondit = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,minimize=no,copyhistory=no,width=700,height=480,left=40,top=60"
str4Page = "MyPage.aspx" myWindow = window.open(str4Page, 'newWin3', strCondit)
}

...just an idea.
 
If you opened the pop up from a parent window using the window.open, then on click of the "close" button in the pop up:
Code:
function closeChildRedirectParent(){
 window.parent.location = "somepage.asp";
 self.close();
}
 
Hope this worked, otherwise:
window.opener.location = "somepage.asp";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top