CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 submitting a form & using onclick custom code

Print topic Send  topic

Author Message
paulmason411


Posts: 127
Posted: 07/16/2008, 12:15 AM

Hi Guys,

I'm trying to use one button to preform two functions:

- Submit post variables to Paypal.
- Run some custom code to insert & remove data into the database

So the opening form tag goes like this:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">

and then the the submit button has custom code attached at Server->On Click

When I test it out, the form submits to Paypal but doesn't run the custom On Click code.

Any ideas why this happens?




_________________

http://paulmason.name - Web Development Blog

View profile  Send private message
jjrjr1


Posts: 942
Posted: 07/16/2008, 9:27 AM

Hi

It is associated with the fact that the client side code will run first on the page. The button does the form submit first and since the form URL is directed to paypal no CCS server side code executes.

I would suggest that have the submit button perform a CCS page submit setting some value to indicate that it is to run the paypal code from the server side in your on click event.

Does that make sense?


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
datadoit
Posted: 07/16/2008, 11:38 AM

JR has given an excellent reason why you were seeing what you're seeing.

Rather than posting directly to PayPal via the form, try to use cURL to
submit to the PP API and Name Value Pairs. PayPal provides working
PHP/cURL examples in the developer's area to get you started.
jjrjr1


Posts: 942
Posted: 07/16/2008, 12:22 PM

Also,

You might consider taking a look at codecharge tools. They are pretty cheap and implement PayPal pretty well, along with other useful tools such as google maps etc...

Have fun

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.