Click to See Complete Forum and Search --> : About auto submit


crorepathi
02-12-2003, 11:38 PM
I want my websites form to be auto submitted after expiry of certain time in visitor browser.Let me know the javascript code please.
Jeya

AdamBrill
02-12-2003, 11:58 PM
Put this line in your script:

setTimeout("document.form1.submit()",1000);

This will wait one second and then submit the form named form1. I hope that helps...

crorepathi
02-13-2003, 12:31 AM
Thanks for the answer.my knowledge is poor on java script and i dont know how to apply above script in my web page.
Any how here is the source code of my webpage and let me know where should i insert and what code should i insert for auto submission
THanks

Source code


<HTML><HEAD><TITLE>Order form</TITLE></HEAD>
<BODY BGCOLOR="#OOFFOO"><B><I><CENTER>Thanks for Enquiry</CENTER></I></B><center>Please fill the details</center><form action="/cgi/formmail" method = "POST" >

<input type="hidden" name="print_blank_fields" value="1">
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,">
<input type="hidden" name="recipient" value="parrysssxxxxx@xxx.com">
<input type="hidden" name="redirect" value="http://www.xxxxxx.com">
<input type="hidden" name="required" value="realname">
<input type="hidden" name="subject" value="Email Subject line">
Your first name: &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" size="26" maxlength="64" name="realname"><br><br>


&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="submit" name="submit" value="CONTINUE">
</form>

AdamBrill
02-13-2003, 07:22 AM
Do something like this:

<HTML><HEAD><TITLE>Order form</TITLE></HEAD>
<BODY BGCOLOR="#OOFFOO"><B><I><CENTER>Thanks for Enquiry</CENTER></I></B><center>Please fill the details</center><form action="/cgi/formmail" method = "POST" >

<input type="hidden" name="print_blank_fields" value="1">
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,">
<input type="hidden" name="recipient" value="parrysssxxxxx@xxx.com">
<input type="hidden" name="redirect" value="http://www.xxxxxx.com">
<input type="hidden" name="required" value="realname">
<input type="hidden" name="subject" value="Email Subject line">
Your first name: <input type="text" size="26" maxlength="64" name="realname"><br><br>


<input type="submit" name="submit" value="CONTINUE">
</form>
<script language=javascript>
setTimeout("document.forms[0].submit();",1000);
</script>
</body>
</html>

Something like that should do. BTW, the forms[0] is because you didn't give the form a name. It will select the first form on the page and submit it after one second. If you want it to submit it without waiting, just take out the setTimeout and put in this:

document.forms[0].submit();