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

submit button runs function after submit 1

Status
Not open for further replies.

damgog

Programmer
Jul 12, 2001
10
IE
I have a frames, and a form with a submit button. When the user clicks the submit button, I would like the form details to be submitted and one of the frames (not the one with the form) to be refreshed.
Any way to do this?

Thanks
 
Hi damgog,

You just have to make a little function like this :

<script language=&quot;javascript&quot;>
function submitAndRefresh() {
//refresh the page in frame
window.top.document.frames['name_of_your_frame'].document.location = &quot;myPage.htm&quot;;
//submit the form
document.forms[0].submit();
};
</script>

in your <html></html>

<input type=&quot;button&quot; name=&quot;myButton&quot; value=&quot;Submit&quot; onClick=&quot;submitAndRefresh();&quot;>

Hope this helps...
 
I can refresh and then submit fine, but I would like the page to refresh after the submit. When the submit button is clicked, the user is not redirected. They remain on the current page, but the form information is posted to another page, which performs some operations. I would like one of the frames on the current page to be refreshed after the submit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top