deserty Posted December 20, 2011 Report Posted December 20, 2011 Am un form de genul <form name="input" action="" method="post"><input type="text" name="1"/><input type="submit" value="Submit" /></form>Iar alt form <form name="send" action="www.xxx.ro/pagina.php" method="post"><input type="text" name="2"/><input type="submit" value="Submit" /></form>As avea nevoie de un cod in javascript care sa dea submit dupa 2 secunde automat la form-ul "send", asta dupa am dat eu submit la primul form. Quote
Nytro Posted December 20, 2011 Report Posted December 20, 2011 Ca sa dai submit, alege una dintre variantele:<form id="form" name="send" action="http://www.google.ro/" method="post"><input type="text" name="2"/><input name="buton" id="btn" type="submit" value="Submit" /></form><script>document.forms[0].submit();document.send.submit();document.getElementById("form").submit();// Sau apesi butonuldocument.forms[0].buton.click();document.send.buton.click();document.getElementById("btn").click();</script>Ca sa dai submit dupa 2 secunde:<script>// Functie care da submitfunction Dupa2Secunde(){ document.forms[0].submit();}// Apel dupa 2 secundesetInterval(Dupa2Secunde, 2000);</script> Quote