Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2003, 06:49 AM
Authorized User
 
Join Date: Jun 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default problem with Popup

Consider i am having an HTML page and i am opening an popup from the HTML page.From the popup i am invoking an small calendar popup to allow the user to choose an date.
My problem is when the user press the Logout button in the main HMTL page i need to automatically close the popup and the calendar popup if they are opened.Now, I can able to close the popup but i can't able to close the calendar popup.Can any one help me how to refer the calendar popup using Javascript from the main HTML page.
Thanks and Regards
T.Gopalakrishnan
 
Old October 27th, 2003, 07:09 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I wouls add code to the first popup to close the calendar automatically if it closed. Attach this code to the onunload event in the popup.



--

Joe
 
Old October 27th, 2003, 07:52 AM
Authorized User
 
Join Date: Jun 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default

Is there any way to communicate the calendar popup from the main page directly, because i have splitted my popup into many frames.


Thanks
 
Old October 27th, 2003, 09:10 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

In that case when you open the calendar do:
Code:
var oCal = window.open(... //this is line where you open calendar.
window.opener.calendar = oCal
then in your original page when you need to close calendar:
Code:
if (window.calendar)
{
  if (!window.calendar.closed)
  {
    window.calendar.close();
  }
}


--

Joe
 
Old October 29th, 2003, 08:27 AM
Authorized User
 
Join Date: Jun 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default

Thank you for the help Joe.It's working





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in closing the parent window from a popup rakesh.kashnia1 Javascript 4 July 9th, 2007 05:39 AM
Popup problem ppayal ASP.NET 1.0 and 1.1 Professional 1 July 21st, 2006 07:05 AM
popup problem carro123 Javascript How-To 0 May 16th, 2005 01:46 PM
Problem with closing popup fs22 Javascript 4 May 20th, 2004 09:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.