Solved

Submit Two Forms with One Submit Button

Posted on 2013-01-30
5
343 Views
Last Modified: 2016-03-24
This is another question that I have researched repeatedly over the years and have yet to find a workable answer. Given how web pages process information these days, it has to be a very common issue.

I have a membership application form. Four things need to be done with the information: it is written to a log file, it is emailed to both the applicant and to the secretary, it is updated in a database and it is passed to Paypal for payment. The first three tasks are accomplished by submitting the form to a VBScript page. Next, a separate form is submitted to Paypal:
 
        {
        document.paypalForm.submit();
        document.emailForm.submit();
        }

I've read repeatedly that two submits with one button won't work, but it works perfectly in IE. It doesn't work in most of the other browsers. There has to be a way to accomplish this. Hopefully, someone out there who has solved this problem and will share it.
0
Comment
Question by:sherleon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 11

Expert Comment

by:Andrew Angell
ID: 38836661
You can add just add the PayPal stuff to the bottom of your VBscript so that you don't have to show a separate form.

What I would recommend is using Express Checkout.  This works over API calls and opens you up to more freedom to build your checkout system the way you want.  

You can add a simple CURL request to pass PayPal all of the order data to start the checkout, and they will pass back a token.  You simply add this token to the end of a redirect URL to PayPal, so when the VBscript is done running the next thing the user would see is the PayPal login (or guest checkout) option.

Once the user is done at PayPal it will send them back to whatever ReturnURL you specify in your SetExpressCheckout request.  

You could also do the same thing a little bit more simply by just building a URL for the payment.  You can use any of the PayPal Standard Variables within a URL to create a payment and simply redirect the user to that URL.

For example, here's a "buy me a beer" URL I've used a lot over the years.

https://www.paypal.com/xclick/business=paypalemail@domain.com&item_name=1%20Beer&currency_code=USD&amount=5.00&shipping=0.00&handling=0.00&tax=0.00

Open in new window


You'll see if you load that URL it'll take you into a payment using those parameters, and again, you can include as many parameters as you want from that standard variable list.  

I personally prefer Express Checkout, but whatever you think is best for your project would work fine.
0
 

Author Comment

by:sherleon
ID: 38839594
I'd thought to do it this way but wasn't sure how to handle the Paypal submit. I'm not familiar with a CURL request but will do some research. I'll give it a try today. It would so make my life simpler.
0
 

Author Comment

by:sherleon
ID: 38841039
OK, I'm going to have to take this a step at a time. All of the data for the database, log file, emails and Paypal are assembled in the main entry form. With my latest updates, I'm passing everything needed for db, log and emails to the VBScript page. I assume I should now include the Paypal data. I have several entry forms, so the number of fields for Paypal varies considerably (I have a separate VBScript for each form). I then assemble a CURL request with the Paypal values passed to hand off to Paypal?
0
 

Accepted Solution

by:
sherleon earned 0 total points
ID: 38841870
I verified that the VBScript page is receiving all the Paypal variables. I've been researching all afternoon how to do the submit and am stumped. Can you help me to get started on where to go from here.
0
 

Author Closing Comment

by:sherleon
ID: 38946870
I didn't mean to accept this as an answer. After the initial response it was ignored for nearly a month. I asked for help and never got it. I found the answer myself. I'm not renewing my subscription.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question