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

Force post without button 1

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
I have a page that submits payment details to Worldpay from a form, hidden fields and a submit button. It works fine. However, what I would now like to do is perform some actions (send an email) on the local server after the submit button has been clicked but before actually posting data to Worldpay.

Is there a way I can achieve this? Can I have my own button acting as 'proceed with payment' and, after it is clicked, direct to my own code which then sends the email and posts the form data without any further user intervention?

I just can't get my head around this - maybe I missing something very obvious?

Thanks in advance.
 
>Can I have my own button acting as 'proceed with payment' and, after it is clicked, direct to my own code which then sends the email and posts the form data without any further user intervention?
Script the handler of the button click event like this, client-side.
[tt]
function yourhandler() {
//do all you intend to do here...
//... etc etc
document.youractualformname.submit();
}
[/tt]
 
Thanks - that definitely sounds worth exploring. So there potentially was indeed something simple I was missing. I will report back.
 
Thanks Tsuji - that seems to have done the trick. I always tend not to think in terms of javascript - to my cost it would appear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top