[Javascript] Sumitting a selection every 4 seconds

Peter Brunone peter at brunone.com
Wed May 19 16:42:00 CDT 2004


Hi Terry,

	How about something like this?

<a href="javascript:clickThis('link1');">Link 1</a>
<a href="javascript:clickThis('link1');">Link 1</a>

<script language="Javascript">
var currentLink;

function clickThis(linkName, binComplete) {
	if(linkName == currentLink && binComplete) {
		whateverForm.submit();
		}
	else {
		currentLink = linkName;
		setTimeout("clickThis(" + linkName + ", true)", 3000);
		}
	}

</script>

Peter

-----Original Message-----
From: javascript-bounces at LaTech.edu On Behalf Of Terry Riegel

Just a quick followup to my question.

Here is a more simplified version of my question.

I would like to have a link when clicked on wait 3 seconds then submit 
a form.
If another link is clicked before the three seconds then it would stop 
the first link from submitting, and it would submit the form 3 seconds 
after it was clicked.
The form would not be submitted until the last link was clicked and 3 
seconds after that click had expired.

The point is to keep connections to the server to a minimum.

Thanks,

Terry

On May 19, 2004, at 5:14 PM, Terry Riegel wrote:

> you can check it out at
>
> http://client1.riegels.com/pages/start/filemanager/filemanager.html
>
> Make sure "Sticky" is selected to see how the multiple selections work
>
> Thanks for any help,
>
> Terry Riegel





More information about the Javascript mailing list