View Full Version : Auto Submit with Delay Script Advise Request

06-16-2009, 05:25 PM
I am not super good at JScript and could use some help. I am trying to get my page to auto submit form data, and I do get it to work fine when only the submit button is used. But when I change over to the auto submit script, it fails to fill the second form (ip address (<!--#echo var="REMOTE_ADDR"-->)) I think that the auto submit script is activated before the ip address can be inputed into the form field? I would like to put a few second delay on the auto submit script if possible? Here is the code.

<SCRIPT LANGUAGE="JavaScript">document.FORM_NAME.submit();</SCRIPT>

I have found something like this but I am unsure on how to insert it into the script?


Thank You,


Also, here is the entire code that i am using:


<script language="javascript">
var ip = '<!--#echo var="REMOTE_ADDR"-->'
function ipval() {

<FORM METHOD="POST" NAME=FORM_NAME ACTION="/cgi-bin/cgiemail/mail.txt">

<INPUT NAME="success" TYPE="hidden" VALUE="success.url">
<INPUT NAME="contact" TYPE="hidden" SIZE="0" value="Page Has Been Visted">
<INPUT NAME="ipaddr" TYPE="hidden" SIZE="0" readonly>


///This is when I was using a submit button and it worked fine///
<INPUT TYPE="submit" VALUE="Submit">

///This is when I was using a Submit Text Link and it worked fine///
<a href='javaScript:document.FORM_NAME.submit()'>Submit</a>



/// this is the script that I would like to time delay so the IP address has a chance to fill the form///

<SCRIPT LANGUAGE="JavaScript">document.FORM_NAME.submit();</SCRIPT>


Thank You Again.


Ok, I figured it out! Yeah!

<SCRIPT LANGUAGE="JavaScript">setTimeout("document.FORM_NAME.submit();",5000);</SCRIPT>

This gave it a 5 second delay and the ip address form was filled in and sent properly.


This script worked out really good for me.

It recorded that the page had been visited, recorded the visitors IP address, then sent it to my mail handler, and I got it to not only email the information to me immediately, but it also sent me a SMS text within seconds to my cell phone. I ran it in a frames page so the visitor never knew it happened. Very Cool!