affordit Posted March 28, 2008 Share Posted March 28, 2008 I am trying to get this form to auto submit after 5 minutes, but don't work. <script language=javascript type=text/javascript> <!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } document.onkeypress = stopRKey; --> </script> <script language=javascript type=text/javascript> setTimeout("submitForm()", 60000); function submitForm() { document.5_min_test.submit(); } </script> <?php print " <form name = '5_min_test' action='print_results.php' method='POST'> <table align='center' border='0'> <tr> <td align = 'left'>Name:</td><td><input type='text' name='name' size='30' maxlength='100'></td> </tr> <tr> <td align = 'left'>Email:</td><td><input type='text' name='email' size='30' maxlength='100'></td> </tr> </table> </form>"; ?> Quote Link to comment Share on other sites More sharing options...
nogray Posted March 28, 2008 Share Posted March 28, 2008 the form name or is can't start with a number name = '5_min_test' you can change it to name = 'five_min_test' Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.