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

Refreshing target frame at the time the form is submitted

Status
Not open for further replies.

Draug

Programmer
Apr 18, 2001
77
CA
Hi,

I have a frameset. One of the frames is populated with servlet results that are based on a form in one of the other frames.

The servlet takes a long time to run. I want to refresh the target frame as soon as the submit button is pressed, so the screen is in its default load-up state while the servlet results are awaited.

On the onClick event of the Submit button, I have added:
parent.myFrame.document.location.replace("myLoadPage.htm");

This does not work. This command does refresh the page when it is used with no relation to the form submit. But in conjunction with the submit, it does not work. However, if I add an alert box immediately after the replace statement, the page is refreshed and then the servlet is called/executed.

What is it about the alert box that allows my page to be refreshed?

Does anyone have an idea of how to do what I want to do?

Thanks so much,
Draug
 
Hello

I had a similar issue with an onClick event in a Form which called a window.location function as part of the event.

That did not work, so instead of having the event called from within the onClick(), I placed it in a function which was called by the onClick().

For example.

function openPage(){
windows.location="mypage.htm";
}

<input type=&quot;img&quot; source=&quot;image.gif&quot; alt=&quot;Submit&quot; name=&quot;Submit&quot; onClick=&quot;openPage();&quot;>

This seems to work for window.location, it may help with myFrame.document.location.

Good luck...


Sofisticat
 
Sofisticat,

Thanks for the advice. Unfortunately, I am already calling the document.location from inside a function which is triggered by the onClick event. And, like I said in the first post, this is not working.

Any other ideas? Anyone?

Thank-you,
Draug
 
Greetings all,

Does anyone have a suggestion for me?

Thanks,
Draug
 
Hiya,

If a client sees an alert, it takes a while before he has processed it. So, when the user presses ok, some considerable time has passed, meaning that your servlet has had enough time to load in the meanwhile.

So, maybe you should simulate this by using setTimeout(&quot;somecode&quot;,3000) (or some other time)

This is just an idea, hope it works in your case. :)

Gtz,

Kristof
 
Have you tried something like window.opener.location.reload(1)? The 1 makes it an unconditional reload. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top