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?

 

 

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

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.