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!

Form with 2 actions, only one button 2

Status
Not open for further replies.

CMcC

Programmer
Feb 5, 2002
196
US
Hi all.
I have a form where the action is a link to a third party vendor for credit card payments. Within this form, I attach hidden variables and submit those with the action to the link.

We want to start adding records to a table to let us know when a customer has "left" our site to go to the credit card processing site.

Im not sure how to proceed with my insertuser.asp (code that will add records to a table on my server) and the url with hidden variables so that the customer does not see.

I thought that maybe within my "insertuser.asp" page - once finished updating the tables, I could perform a redirect to the third party URl, although all the hidden variables are lost. I also tried passing the hidden variables to my insertuser.asp and concatenate a querystring to send, but I keep getting "unterminated string constant" errors.

Any suggestions as to how to add a record to a table before the user sends to the third party vendor?

Thanks so much in advance for any help!
CMCC
 
You could use session variables. They should remain persistent.
 
That screams AJAX to me.

Check for a really simple tutorial on AJAX.

Basically you move your "update" to a separate ASP page.
change your submit button to a "button" instead of a submit.

You write a little javascript function that passes whatever you need updated to your update.asp with
xmlhttp.open("GET","update.asp?variable1=blahblahblah&variable2=blah",true);
xmlhttp.send();

then you add your code to go to the credit card processing.

It would take you 10 minutes to through the tutorial on W3Schools.

One hint for debugging because the update functionality isn't going to display anything on your screen. Use Window.Open first so that you can debug your update.asp. Once it works well, change that window.open to the xmlhttp.open and .send

To build may have to be the slow laborious task of years. To destroy can simply be the thoughtless act of a single day.
 
Thanks to both of you for your help. Im only alittle familiar with AJAX, so I will definitely check out that tutorial link that you provided Jeepxo.

The need for it isnt as important as it was when I posted, but it is helpful to know how to - in case I need it in the future!

CMCC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top