Forum Moderators: open

Message Too Old, No Replies

A way to refresh another page?

         

dreaming of nascar

4:55 pm on Feb 13, 2003 (gmt 0)

10+ Year Member



I was wondering if there is any way to refresh a page that is under another one. I have a page that comes up and the user enters information. When they click submit, I would like the "main" page to refresh with the new contents. Does anyone know if this is possible at all? Thanks

dreaming of nascar

HocusPocus

7:29 pm on Feb 13, 2003 (gmt 0)

10+ Year Member



d_o_n,

I assume you mean you have a frameset, with a page within a frame that contains a form, and you need the Content frame page to change depending on the input of that form.

Broadly speaking, give your frames useful names. Maybe navframe, mainframe.

On the page with the form you need something like
<script>
function go()
{
mainframe.location.href=document.theform.search.value +".html"
}</script>

<form name=theform>
<input type=text name=search>
<input type=button value=gogo onclick="go()">
</form>

This changes the mainframe document to whatever you enter in the Search box on the form.

Eg home
would load up home.html

Hope this helps

tedster

2:07 am on Feb 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The other possiblity you may be describing is that your "main" page has opened a new window that now sits on top of the stack.

If that's the case, you can refresh the main window with code in the new window by using window.opener.reload()
Note that the method is reload() and NOT refresh() which addresses the plug-in list.

dreaming of nascar

3:18 am on Feb 14, 2003 (gmt 0)

10+ Year Member



That is what I am talking about tedster. How do you call the page that I want refreshed? Do I use opener or do I have to name the page somehow? If I do have to name the page how do I do that? Thanks. I think this is what I am wanting to do.

dreaming of nascar

tedster

4:49 am on Feb 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, you don't need to name the page.

window.opener is the original window when it's addressed as an object from the new window. So window.opener.reload() will do it. You can call it onSubmit, or onUnload or whatever makes sense in your situation.