Wrox Programmer Forums
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning 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 December 9th, 2007, 12:31 PM
Registered User
 
Join Date: Dec 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Issue with showModalWindow

Hi,
I have an issue with Modadialog, my requirement is:
In parent window I have a button.
When I click on the button a modal(child) window should open.
In the child window I have a "close" button.
If I click on the close button, my child and parent window should close.
How can i do it?
Note: I'm using IE 6.0.
Parent window code:
<HTML>
 <BODY >
    <input type="button" value="Show Modal" onclick="javascript:openChild();"/>
 </BODY>
</HTML>


<script type="text/javascript">

function openChild()
{
  var returnValue = window.showModalDialog("C:\Child.html");
  if (returnValue == 1)
  {
        self.opener = this;
        self.close();
  }
}

</script>

Child window code:
<HTML>
<BODY>
<a href="javascript:windowclose();"><img id="Close" height="20" alt="Close" hspace="10" src="c:\Close.gif" width="69" border="0" name="Close" ></a>
</BODY>
</HTML>

<script type="text/javascript" language="javascript">

function windowclose()
{
        var ans = confirm("Do you like to be in child window?")
        if (!ans)
        {
            returnValue = 1;
            self.opener = this;
            self.close();
        }
}
</script>

Thanks in advance,
Suba





Similar Threads
Thread Thread Starter Forum Replies Last Post
Com issue(really urgent) balesh.mind ASP.NET 2.0 Professional 2 May 14th, 2008 03:35 AM
Drop Down Issue SKhna ASP.NET 2.0 Basics 1 March 19th, 2008 06:29 AM
Issue with DTD tgopal CSS Cascading Style Sheets 2 September 20th, 2006 04:15 AM
Another issue islandtiu BOOK: Beginning ASP 3.0 1 February 14th, 2005 11:49 AM
Sub Report Issue bjoneskc01 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 January 21st, 2005 11:26 AM





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