Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

showModalDialog + refresh

Status
Not open for further replies.

RhythmAddict112

Programmer
Joined
Jun 17, 2004
Messages
625
Location
US
Hi all,
I'm developing a web app and using showModalDialog to pop up a window (IE across the board - controlled environment)
In any case, I wanted to know if there is a way I could have the page that I am popping up refresh the page that popped it up when it is closed.

Let me explain..

Upload.asp conatins a button that pops up a window (document.asp)

When document is closed, is there anyway to refresh upload.asp? I feel like I could put some kind of event in the unLoad of the body of upload.asp - unsure how to go about it though

All hail the INTERWEB!
 
My fault, I failed to mention something (though I wasn't sure it would matter at the time..) my apologies.

I should have mentioned that Upload.ASP itself it popped up using showModalDialog.

so what happens now is this...

i click the button that uses S/M/D to pop up upload.asp Upload uses s/m/d to display documents.asp - documents does some processing, and closes..I need to refresh upload.asp, however. I know, this is a mess...but unfortunately I didnt develop this and dont have time to rework this...

I tried changing it so documents.asp is an iframe on uploads.asp, and then doign a parent.relocation.reload(); but no luck.

Once again, hate to be the guy changing his orig. question so no worries if you havent got a solution off the top of your head.

Lastly, that was some quick response time!

All hail the INTERWEB!
 
The only way I know how to refresh a modal dialog is to submit a form with the base tag set.

First Page (test1.html)
Code:
<script>
var results = showModalDialog('test2.html');
</script>

Second Page (test2.html)
Code:
<base target="_self" />
<form name="f"></form>
<script>
function openit(){
  var results = showModalDialog('test3.html');
  if(results)document.f.submit();
}
</script>
<a href="" onclick="openit();return false">popup</a>

Third Page (test3.html)
Code:
<input type="button" value="OK" onclick="window.returnValue=true;window.close()">
<input type="button" value="Cancel" onclick="window.returnValue=false;window.close()">

Adam

There are only 10 types of people in the world: Those who understand binary, and those who don't
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top