Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Two Actions with one form
- From: mwarden at gmail.com (Matt Warden)
- Subject: [Javascript] Two Actions with one form
- Date: Sun Mar 26 16:05:18 2006
On 3/26/06, Del Wegener <del@xxxxxxxxxx> wrote: > Good Day; > > Upon submission of a form I would like two actions to happen: > action="/cgi-bin/bizdb-aed.cgi" to put the contents of the form in a > database > action=https://www.paypal.com/cgi-bin/webscr > > How do I accomplish this? > > I am guessing JavaScript -- that's why I tried this list. > > Thanks for any help. Often you can make a return page from payment sites like paypal. These will either post back all the content, or return it to you in the query string. You might be able to do this with paypal. I would check that first. Failing that, you might have your cgi issue a post request to paypal. This is not ideal, because paypal is probably expecting to be dealing with the user agent of your customer, whereas in this case the user agent would be your cgi script. This could cause problems. Your other option is to submit to the form contents to your CGI with something like XMLHTTP/AJAX, and then allow the form to post to paypal. Something like: <form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return postToCGI();"> function postToCGI() { // do ajax to post to CGI with XMLHTTP/XmlHttpRequest return true; } -- Matt Warden Miami University Oxford, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy.
- References:
- [Javascript] Two Actions with one form
- From: Del Wegener
- [Javascript] Two Actions with one form
- Prev by Date: [Javascript] Two Actions with one form
- Next by Date: [Javascript] Two Actions with one form
- Previous by thread: [Javascript] Two Actions with one form
- Next by thread: [Javascript] Two Actions with one form
- Index(es):