Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms - Multiple Submits to different addresses

Status
Not open for further replies.

brad10

Technical User
Jun 5, 2001
33
GB
I have a form which has several submit buttons on it.

When a user completes the form they need to then send it to a certain address depending on the information gained. How do I do this so that I have one form with an option of submit buttons. Most forms tend to have one submit button attached to the form fields. My problems is attaching a selection of buttons to the form fields for the user to choose from. Can you help????
 
You can do it if you use server-site script, I did it ones in ASP, so if you need this example, let me know.

Further I suggest to do some key-word searches. There is allready written more about this subject.

I found this:
thread216-77502

Erik
 
Cheers Boomerang - I did see the previous thread but it didn't really seem to cover what I'm after.

If you could give me an example of the ASP scripts you have that would be great.
 
OK Brad10, I will give you the ASP script next work-week because I don't have it at home here. If you mark this mail for email notification you know immediately when I posted it.

Erik
 
Hi Brad10,

Here is the ASP example:

This code is in the file “indexmut.asp”

<%
if Request.Form(&quot;submitinsert&quot;) = &quot;Insert the value&quot; then
Response.Redirect(&quot;insert.asp&quot;)
end if
if Request.Form(&quot;submitupdate&quot;) = &quot;Update the value&quot; then
Response.Redirect(&quot;update.asp&quot;)
end if
if Request.Form(&quot;submitstop&quot;) = &quot;Stop this action&quot; then
Response.Redirect(&quot;stop.asp&quot;)
end if
%>

<form method=&quot;post&quot; name=&quot;ki_index&quot; action=&quot;/indexmut.asp&quot;>
<INPUT TYPE=&quot;submit&quot; name=&quot;submitinsert&quot; value=&quot;Insert the value&quot;>
&nbsp;
<INPUT TYPE=&quot;submit&quot; name=&quot;submitupdate&quot; value=&quot;Update the value&quot;>
<INPUT TYPE=&quot;submit&quot; name=&quot;submitstop&quot; value=&quot;Stop this action&quot;>
</form>

Hope this helps,
Erik
 
without asp, this is lighter (not to code, but as it doesn't require an extra call to the server - i would have chosen the asp solution only if it was doing treatments in indexmut.asp, but as it only redirects ...):
<form method=&quot;post&quot; name=&quot;ki_index&quot;>
<INPUT TYPE=&quot;button&quot; name=&quot;submitinsert&quot; value=&quot;Insert the value&quot; onclick=&quot;javascript:redirect('submitinsert')&quot;>
...
</form>

and the redirect() function is

function redirect(which){
if (which==&quot;submitupdate&quot;)
document.ki_index.action=&quot;update.asp&quot;;
document.ki_index.submit();
else
...
// or a switch or elseifs ...
}
 

Cheers for your previous help Boomerang.

Iza, I understand the theory of the function but I don't see how it would submit the form data to the different email addresses? I'm fairly new to this so if someone could be a little more detailed it would really help me out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top