delickate Posted July 21, 2008 Share Posted July 21, 2008 Hi guys, I want to submit two form of data in same file but it transfere one of them. my code is: <script> function send() { document.form1PU.submit(); document.form1DO.submit(); } </script> <form name="form1PU" method="post" action="process2.php" enctype="multipart/form-data" > </form> <form name="form1DO" method="post" action="process2.php" enctype="multipart/form-data" > </form> <input name="button" type="button" class="button" id="button" value="Continue To Next Setup" onclick="send()" /> anybody knows how to plz? Quote Link to comment Share on other sites More sharing options...
samshel Posted July 21, 2008 Share Posted July 21, 2008 this will not work...you cannot submit 2 forms one after another, the page will refresh when you submit first form. you should try to keep all data in one form. if not, then you will have to look for something like submitting to form to an iframe or frame so the page does not refresh and allows second form to submit too.. hth Quote Link to comment Share on other sites More sharing options...
rarebit Posted July 21, 2008 Share Posted July 21, 2008 I agree with samshel it is really a single form... however you could use your javascript to read through the other form and either send it along with GET or add to a hidden field or similar... The single form method is simpler and remember you can have numerous buttons within a single form! 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.