I'm using IE's showModelessDialog command and I am at a loss on how to use these things ( have yet to find a good resource) hopefully you can help.
I have two problems that I need solving.
1. When I click on a link in the modelessDialog it opens the link in a NEW window so now I have 3 windows (the parent, the modeless one and this new one). I want the link to open in the modelessDialog
2.How can I make the modeless dialog refresh the parent when you close it?
Main.html
-------------------------
<html>
<head>
<title>Main</title>
<script language="Javascript1.2">
function modelesswin(url,mwidth,mhe
ight){
eval('window.showModelessD
ialog(url,
window,"he
lp:0;resiz
able:1;dia
logWidth:'
+mwidth+'p
x;dialogHe
ight:'+mhe
ight+'px")
')
}
</script>
</head>
<body>
<SCRIPT>
document.write(Date()+".")
</SCRIPT>
<br><br>
This is the main page.<br><br>
<a href="javascript:modelessw
in('popup.
html', 300, 300)">Click here</a> to open a modal window
</body>
</html>
popup.html
----------------------
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title>Popup</title>
<script language="JavaScript1.2">
function refreshMain(){
//CODE HERE
}
</script>
</head>
<body>
This is the popup page.<br><br>
<a href="javascript:refreshMa
in();">Cli
ck here</a> close this window and refresh the main window.
<br><br>
<a href="
http://www.cnn.com">Click here</a> load something new in this window.
</body>
</html>
(1) You cannot navigate the modeless dialog window. The URL that you open in the modeless dialog is the only URL that can appear in it.
(2) To have the main window refresh when the modeless dialog is closed, you need to add the following line of code into the refreshMain() function:
function RefreshMain() {
window.dialogArguments.loc
}
Then, since you can't navigate the modeless dialog window, you cannot use an <a></a> object's "href" property to call the function through the javascript protocol. You have to unfortunately use the onclick event handler of the <input type="button"> object:
<input type="button" value="Refresh Main Window" onclick="refreshMain()">
Hope this helps. Let me know if you have any other questions.
gator4life
(chomp, chomp)