Click to See Complete Forum and Search --> : Multiple form POST's from one Submit?? Possible?!?


PommyTom
11-11-2005, 03:04 AM
Hi,

Just wondering if anyone has ANY idea if this is even possible... And how it could be acheived.... Not sure if this should be attempted with ASP or if its possible with plain and simple HTML...


I need to post to two sites from one submission button. I can get all the objects to be posted into one form but how on earth are you meant to post to two seperate locations?! Is this even possible?

I need to post to one external database some information but at the same time we're trying to use an external auto responder system so i need to post their email address etc to another?


Any help would be GREATLY appreciated!!!! If you require any further information please don't hesitate to ask!


Many thanks,
Tom

Giskard
11-11-2005, 11:10 AM
I'm assuming that you need to send the information to two pages that you can't modify. (If you can modify the two pages then you should be able to combine them into one page and not have a problem.)

The following method is only possible if at least one of the two pages can handle receiving the data as a GET (REQUEST.QUERYSTRING("") or REQUEST("")).

What you need to do is to make the submit button, just a normal button and place a onClick event to execute a JavaScript function. You need to make sure that you give your form a "name" and have the action point to one of the two pages.

The JavaScript function needs to be added in the <head> section of your page and should look something like this:


<script>
function fncSubmitTwo()
{
window.open("Page2.asp?Parm1="+frmName.Parm1+"...")
frmName.Submit()
}
</script>


Hope this helps

PommyTom
11-13-2005, 05:53 PM
Thanks for the response guys... Worked it out in the shower... amazing how much you work out in the shower!

Just going to have it sent to the first page, store the contents in the session object (asp page), then from the first page it allows a redirect, and on that page resubmit to the second page the contents of the session variable.


Thanks for the help anyway,


Tom