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
|