Send FORM data to different scripts

admin

Administrator
Staff member
10% of browsers disable javascript!
I would like to send form data to 2 different scripts depending on which button is clicked.
Here's is how I do it using javascript. How do I accomplish the same thing without using javascript? <script type="text/javascript">
<!--
function sendto(which) {
if (which == "A") { document.theform.action = "...cgi-bin/scriptA.cgi" }
else { document.theform.action = "...cgi-bin/scriptB.cgi" }
document.theform.submit()
}
//-->
</script>
....

....
<form name="theform" action="" method="post">
<input name="elementA" type="text">
<input name="elementB" type="text">
<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Submit to scriptA" onClick="sendto('A')">
<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Submit to scriptB" onClick="sendto('B')">
</form>
....
 
Back
Top