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

Autorefresh a form every 10 seconds

Status
Not open for further replies.

DarVar

Programmer
Mar 14, 2006
10
IE
Hi I have a simple form I want to auto submit every 10 seconds

I want the submit it with out refreshing the whole page.
i.e. I tried the following but it refreshes the whole page first

function setup(){
window.setInterval("submitform()",10000);
}

function submitform()
{
document.forms[0].submit();
}

 
You'll need to use iframes or frames (or a popup or new window) if you want to submit the form without refreshnig the whole page.

Simply target the form to the frame name:

Code:
<form ... target="frameName">

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
*building on BillyRayPreachersSon's post* you can also set many attributes for the target window if you'd like to make this action a little more transparent to the end user (i.e. have the target window be an iframe with [tt]visibility=invisible[/tt]).

I guess my biggest question, however, would be why are you wanting to submit the form every 10 seconds? That jsut sounds like a LOT of extraneous information being dumped somewhere on your server for you to have to wade through later to me.


I hope this helps;
Rob Hercules
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top