Hi everyone, i need to auto submit a form on page refresh every 5 seconds.
This is what i have done but does not work
Code:<html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> </head> <body> <form id="myform" name="myform" action="POSTadat.php" method="POST"> <input type="text" name="myname"> <input type="submit"> </form> <script> $(document).ready(function() { setTimeout(function() { $('#myform').submit(); }, 1000); $('#myform').submit(function(e) { e.preventDefault(); }); }); </script> </body> </html>



Reply With Quote

Bookmarks