Jump to content

Help in Submit 2 form with one button plz


delickate

Recommended Posts

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?

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.