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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two form actions? 1

Status
Not open for further replies.

derwent

Programmer
May 5, 2004
428
GB
I am passing details to worldpay using a standard form

<form action="method=POST>

I would also like to store the info in a DB of my own. Is there a way to also pass the form to say /formprocess.asp that will contain scripts to dump into my DB?
 
Hi,

The only way i know of doing this is with JavaScript onSubmit event on the form. This only works if the user has javascript enabled.

Hope this helps

Cheers

Russell
 
I already have one onsubmit event (the form validation). Can I have more than one?
 

You don't need more than one. Put code in your existing submission routine to duplicate all form information to another form, and submit that (using an iframe / frame) to achieve what you're after.

Suggest asking in the JavaScript forum if you need more help with this.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Which language are you writing the site in?

I know that ColdFusion (v4.0 i think) used to have a way of re-submitting a form after looking at it and using the values.

ASP has a similar thing with server.transfer, but that can only be a "local" page using relative URLS.

Cheers

Russell
 
thanks for the help.

I`m using asp to add the data to the DB.

I tried using onSubmit="window.open('adddatabase.asp')" but obviously that doesn`t pick the request("") from the form.

I knwo this is easy but cannot get my head around it today!
 
You could submit the form to /formprocess.asp and then put a hidden form on that page replicating the form values and inserting the request.form("") to it.

Then on /formprocess.asp have a OnLoad() in the body tag that submits the new hidden form..

Hope that helps.

Cheers

Russell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top