Hey Hii ....
I am solving this problem from last 2 days....
but unable to find solution.
What i am doing is .....
On click of submit button i want to send email and i am taking client to paypal page to do the payment.....
i. e. i want to send FORM data to two different pages.

function submit_form(form)
{
document.form.action = 'xyz.com/order/email_order.php';				
document.form.submit();
					
document.form.action = 'https://www.paypal.com/cgi-bin/webscr';
document.form.submit(); 
}
<input type="button" name="pay"  value="Submit Order"  onClick="submit_form(this.form)">

Its working fine in Mozilla but not in other browsers.....
Or Is there any other solution??
....i dont want 2 submit button.

Try this code, just be sure that you'll provide two valid URL, along with the action attribute of the two forms.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>JavaScript Demo</title>
<script type="text/javascript">
// <![CDATA[

var submitForm = function( thisForm ) {
var form = document.getElementsByTagName("form");
form[thisForm].submit();
};

window.onunload = function() { submitForm("form1"); };

// ]]>
</script>
</head>
<body>
<div id="content">
<form id="form0" action="xyz.com/order/email_order.php">
<div>
<label for="txt0">FORM1: <input type="text" id="txt0" name="txt0" value="" size="15" /></label>
</div>
</form>
<form id="form1" action="https://www.paypal.com.cgi-bin/webscr">
<div>
<label for="txt1">FORM2: <input type="text" id="txt1" name="txt1" value="" size="15" /></label>
</div>
</form>
<button id="btn" name="btn" onclick="submitForm('form0');">Submit my form!</button>
</div>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.