affordit Posted March 28, 2008 Share Posted March 28, 2008 I want the form below to auto submit after 5 minutes but does not work can anyone tell me why? <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>"; ?> Link to comment https://forums.phpfreaks.com/topic/98353-help-with-php-form-submission/ Share on other sites More sharing options...
discomatt Posted March 28, 2008 Share Posted March 28, 2008 This is not a PHP issue. Link to comment https://forums.phpfreaks.com/topic/98353-help-with-php-form-submission/#findComment-503307 Share on other sites More sharing options...
redarrow Posted March 28, 2008 Share Posted March 28, 2008 I gave javascript up but here a hint... <form name="SomeName" action= .... form stuff </form> <script type="text/javascript"> setTimeout('document.SomeName.submit()',5000); </script> Link to comment https://forums.phpfreaks.com/topic/98353-help-with-php-form-submission/#findComment-503312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.