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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh a Modal Dialog

Status
Not open for further replies.

jl8789

MIS
May 22, 2003
293
US
I have a window that I open with .showModalDialog because the user has to use this windo before going back to parent etc. My problem is that I want to give the user a button to refresh this window as they are working with it. I am using,

<script>
function refreshPage(){
thisPage = document.location.href
document.location = thisPage
}
</script>

<input type=button onClick=&quot;refreshPage()&quot; value=&quot;Refresh&quot;>


Problem is it opens another instance of the window!!

How can I refresh this window?

Thank You
 
were is the button gonna be...inside the modal dialog or in the parent page
 
Assuming that you want the button to refresh the window it is placed in -try this:

Code:
<BUTTON onClick=&quot;self.location.reload();&quot;>REFRESH</BUTTON>

Good Luck §;O)


Jakob
 
Nothing is working. I tried document.name.reload() and it tells me object doesn't support this. I have tried window.location.reload, and many other things...

Please help.
 
You have to tell us where you want the button...


Jakob
 
I have a main window, and then open up a popup window with showModalDialog. I want the refresh button on the dialog window, so that a user can refresh that popup as needed.
 
... oh, I see now! I'm not familiar with showModalDialog, but I'm guessing that you can put my code into the page URL'ed by showModalDialog()...?!

Good Luck §;O)


Jakob
 
Can't use
<BUTTON onClick=&quot;self.location.reload();&quot;>REFRESH</BUTTON>

or window.location.reload();

Seems you just can't refresh a modal dialog window.

Grr--- there has to be a way!
 
No prob!

How about using a regular popup that sends back it's values to the parent?! Just throwing ideas to the table...


§;O) Jakob
 
I already use returnValue to the main window to refresh that when the popup closes. I am trying to refresh the POPUP.

Can I just use a button to do TABLE.refresh to the table I am trying to bring back values in?

I am going to try that now.
 
Could you just kill the popupwindow and use that return value to trigger the main to reopen the window? It's a bit sloppy, I know, but it would achieve close to the same effect.

-kaht

banghead.gif
 
I have the same problem as you have with reloading the contents of a modal window. The first thing I found that you must do is to fool IE that you don't change the window. You do this with a frame that is 100%. I have a php script that takes this parameters and then only outputs a frameset with the page in it:
openWindow.php?page=somepage.php

This will make it possible to submit forms and to have links in the new window. And you will not loose the parameters send to the window.

My problem now is that I can't refrese the frame. The script works if I don't open it as a modal window. The only possible solution I see now is to post a empty form or something like that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top