Forum Moderators: open
I have a code which would auto-submit a POST form so that I could get to know my site visitors where as it would post some details about them ....But, the problem is, it keep submitting the same information over and over again!....I meant, it keeps looping!....I dunno how to make the form auto-submit only once!....And oh yeah, the form is targetted to a IFRAME so that the page won't change to another page!..
thanx in advance! =)
here's an overview look of the code :
<script type="text/javascript">
window.onload = function () {document.tracker_form.submit();}
</script>
<form name="tracker_form" action="tracker.php" target="nothing" method="post">
.............
.............
.............
.............
</form>
<iframe name="nothing" width=1 height=1 scrolling=no></iframe>
I tried your method but the form never submitted any information at all.. =(
here's the code that I used :
<script type="text/javascript">
window.onload = function (){window.onload=NULL;document.tracker_form.submit();}
</script>
<form name="tracker_form" action="tracker.php" target="nothing" method="post">
.............
.............
.............
.............
</form>
<iframe name="nothing" width=1 height=1 scrolling=no></iframe>
thanx again!
@ orion_rus - thanx for the help, but, im a newbie in this javascript thingy!...could u edit the code that I had given in my first post and help me out?...thanx in advance! =)
<body onload={alert(1);document.tracker_form.submit();alert(2);} >
...
<form name="tracker_form" action="tracker.php" target="nothing" method="post">
.............
.............
.............
.............
</form>
<iframe name="nothing" width=1 height=1 scrolling=no></iframe>
...
</body>
The alerts, bold text, are there for debugging only (to see where looping), take out if all goes well.