Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 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, 11:36 AM
Registered User
 
Join Date: Dec 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default showModalDialog - issue

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
 
Old December 9th, 2007, 11:38 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

To what chapter / page number of the book Beginning Dreamweaver MX is this related?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old January 23rd, 2008, 07:08 AM
Registered User
 
Join Date: Jan 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to awaisusmanbutt Send a message via Yahoo to awaisusmanbutt
Default

Just call the following Method after the line you called for show Modal Dialog
var returnValue = window.showModalDialog(****************);
window.close();

Awais Usman Butt





Similar Threads
Thread Thread Starter Forum Replies Last Post
showModalDialog Problem akhilesh_g Javascript 0 July 14th, 2008 06:43 AM
Problem with using showModalDialog savoym Javascript How-To 1 May 3rd, 2007 04:30 PM
ShowModalDialog DarrenMelling Javascript How-To 7 February 17th, 2005 11:59 AM
showModalDialog() leion General .NET 3 June 6th, 2004 04:08 PM





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