Try to use javascript.
Paste this javascript on top of your html <body> tag
<SCRIPT LANGUAGE="JavaScript">
<!--
function SubmitA()
{
document.forms[0].action = "WebA.asp";
document.forms[0].submit()
}
function SubmitB()
{
document.forms[0].action = "WebB.asp";
document.forms[0].submit()
}
// -->
</SCRIPT>
then find your submit buttons code and replace them with this.
<INPUT TYPE=BUTTON VALUE="SubmitA" ONCLICK="SubmitA();">
<INPUT TYPE=BUTTON VALUE="SubmitB" ONCLICK="SubmitB();">
Modify the button name and page name according to your preference.
Try this complete code and u will see how it works.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function SubmitA()
{
if (confirm("This will delete products! Are you sure you want to do this!?"))
{
document.forms[0].action = "WebA.asp";
document.forms[0].submit()
}
}
function SubmitB()
{
document.forms[0].action = "WebB.asp";
document.forms[0].submit()
}
// -->
</SCRIPT>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="WebA.asp">
<p>
<input type="text" name="textfield">
</p>
<p>
<INPUT TYPE=BUTTON VALUE="SubmitA" ONCLICK="SubmitA();">
<INPUT TYPE=BUTTON VALUE="SubmitB" ONCLICK="SubmitB();">
</p>
</form>
</body>
</html>
Main Topics
Browse All Topics





by: webdiva69Posted on 2002-01-03 at 11:14:18ID: 6708422
You can do that. YOu NAME each submit button.
For instance if you have
<input type="submit" name="submit1" value="Submit">
and
<input type="submit" name="submit2" value="Submit">
Then on your next page, not sure if you are using ASP or Cold Fusion or what. But if variable submit1 exists you can run one thing if variable submit2 exists you can run the other thing. I have done this quite a few times myself. Let me know if you need further clarification.