Click to See Complete Forum and Search --> : Running more than one Asp file from a form!


FlagstaffRoy
10-15-2006, 12:40 PM
I have a form that triggers an asp file upon submit ...

<form action="asp-mail2.asp" method="post" name="frmContact" id="frmContact">

Could I trigger more than one asp file thru this form by clicking Submit?
What order would they run at?

i.e.
<form action="asp-mail1.asp" method="post" name="frmContact" id="frmContact">
<form action="asp-mail2.asp" method="post" name="frmContact" id="frmContact">

vanny
10-15-2006, 08:04 PM
Im pretty sure this wont work, as the it will fire the second of the 2 forms. asp-mail2.asp

If you wanted to forms to process, you would need to have them in frames, iframes, or have code in the backend to process the first one, then submit the information to the 2nd one if required.

I think you need to have a look at what you are trying to acheive and set up better functions to process the information required.

EG (really rough examples)

IF option1 = "yes" THEN
processFunction1
END IF

IF option2 = "yes" THEN
processFunction2
END IF

FlagstaffRoy
10-15-2006, 09:52 PM
Thanks for your suggestions.
What if I place two processes within same asp file. Here is my code:

http://plumpix.com/aspfile3.htm

Thanks,
Ron

etylocus
10-19-2006, 03:54 AM
As vanny said, you can process the same form twice in the same file. But if you still want to keep your code in 2 separated files, you can use the transfer (http://www.w3schools.com/asp/met_transfer.asp) method or the execute (http://www.w3schools.com/asp/met_execute.asp) method of the server object, depending on what you need.