saseow
Posts: 744
|
| Posted: 07/08/2010, 2:17 AM |
|
I have a grid that displays product information and has a PayPal button created with the CCT PayPal Button Builder.
When a user clicks the button to purchase the item, I want to have a validate event where I can add some data to a table.
The problem is that the button action goes directly to the PayPal web site and there is no way I can see to write some code to add the data to a table.
Anyone have a suggestion or work-around?
|
 |
 |
datadoit
|
| Posted: 07/08/2010, 10:39 AM |
|
Create an AJAX call for the button's Client On Click event.
Another route is to encase your button into a CCS form, then you'll be
able to have server side control over events such as the Button OnClick,
form BeforeInsert, etc., then use the PHP header() to redirect onward to
PayPal afterwards.
|
|
|
 |
saseow
Posts: 744
|
| Posted: 07/08/2010, 11:00 AM |
|
Now, the idea of a form sounds very good. I will give it a try on the morrow and will let you know.
Thanks datadoit! Appreciate your input very much!
|
 |
 |
saseow
Posts: 744
|
| Posted: 07/08/2010, 10:33 PM |
|
What I did was to change the grid to a record form so that would give me validation routines. In the validation routine I wrote the data to the table and then redirected to a PayPal Gate page which contained a form with all the PayPal required fields.
This form I then automatically submitted with onload Submit().
Works perfectly.
|
 |
 |
datadoit
|
| Posted: 07/09/2010, 5:46 AM |
|
There are many instances where a record form with buttons will be used
for the sole reason of being able to utilize CCS event routines.
Oftentimes the record form doesn't even need to update any record at
all. Other times it may just merely update a log table via hidden
fields with the user's chosen answer or button selection.
Very handy trick without all the hassle of AJAX.
|
|
|
 |
saseow
Posts: 744
|
| Posted: 07/09/2010, 7:23 AM |
|
Agreed!
Thanks for planting the idea datadoit!
|
 |
 |