PDA

View Full Version : onload submit ... but only once.



dsdemmin
Nov 3rd, 2002, 10:48 AM
How can I use a onload submit script and restrict the submit to only one occurance.

onLoad="javascript:document.form1.submit();"

Background:

I have a perl poll script in which I show results graphically (i.e. bars) but in order to show the latest results, the page needs to reload once.

<form action="http://www.dsdwebworks.com/cgi/vote.pl" name="form1" method=get>

The above onLoad/submit causes an endless loop.

Thanks for any help.

D. Scott

joh6nn
Nov 3rd, 2002, 02:27 PM
onLoad="if (location.search.length < 1){document.form1.submit();"}

dsdemmin
Nov 3rd, 2002, 07:18 PM
Minor typo:

onLoad="if (location.search.length < 1){document.form1.submit();}"

Thanks Joh6nn