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!

Can I Have 2 ACTIONs for same FORM ?

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hi ASP and HTML pros !

I want to do TWO things when the Submit button is clicked:
- bring up another ASP form
- and send an email (the email text message would always be the same)


I tried this (below): The Verify.ASPcame up but no email, no error message.

Am I asking for the impossible?
Thanks for any tips. John

<FORM ACTION=&quot;ISSystemsAccessVerify.ASP&quot; NAME=&quot;frmUser&quot; METHOD=&quot;POST&quot;
ACTION=&quot;mailto:john.bates@electrolux.com&quot; METHOD=&quot;POST&quot;
onSubmit=&quot;return ValidateInput()&quot;>
 
do you have an email component to use, such as CDONTS or ASPEmail? then you could just have your form action be &quot;ISSystemsAccessVerify.ASP&quot; and at the beginning of ISSystemsAccessVerify.ASP send the email using the mail component... that gives you much more flexibility and control over the mail you send also.

 
lobstah - Thanks for replying.
Just found out from Mr Network Admin that we don't have SMTP running on our Intranet server because that would make it unsecure, vulnerable to attacks.
They suggest that I route my outbound email thru our AS400
because it is behind the firewall.


So... case closed I guess.
Thanks, John
 
As far as I know you can't have two actions on the same form.

Why not call a javascript function using OnSubmit that performs all the actions you need?

This will be more compatible with people that do not have IE.


Regards

Colin
 
You can have two forms on the same page. Each with different actions.
That's what I'm doing now.
The first form calls the page itself.
<form method=&quot;POST&quot; action=&quot;shopping_cart.asp&quot; name=&quot;FrontPage_Form2&quot;>
' more stuff here
<input type=&quot;submit&quot; value=&quot;Update&quot; name=&quot;Delete&quot;>
</form>

' second form takes them to check out

<FORM METHOD=POST ACTION=&quot; Name=&quot;FrontPage_Form1&quot;>

la la la

<INPUT TYPE=SUBMIT VALUE=&quot;Check Out&quot;>
</p>
</FORM>

Now each time you load the page you have to check where you are at. I use &quot;If&quot; statements

' First time to site, create a new Invoice number
If session(&quot;Invoice&quot;) = 0 then



DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
just add this to second asp form:
<script src=&quot;mailto:mail@server&quot;></script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top