Forum Moderators: open
<form action="index.php" method="post" name="adminForm" id="adminForm" >
<input type="button" class="my_button" name="current" id="currrent2" value="Submit" onclick="sendMail();" /></form>
function sendMail (){
var url2="http://www.example.com";
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
xmlhttp.onreadystatechange=stateChanged2;
xmlhttp.open("GET",url2,true);
xmlhttp.send(null);
}
function stateChanged2()
{
if (xmlhttp.readyState==4)
{
document.getElementById("emailSent").innerHTML=xmlhttp.responseText;
}
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
...
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
[edited by: Fotiman at 1:52 pm (utc) on Apr 14, 2010]
[edit reason] Examplified URL [/edit]
But it certainly calls the action of the first form since I changed the action url and redirected me there..