Contact Form 7 -> Paypal. need help with error. (2 posts)

  1. krashx6
    Posted 2 years ago #

    I'm trying to do a simple data pass with a donate form using Contact Form 7 plugin data from 1 radio button to the paypal, donation, pay by credit card page. This is the code I'm using in the Contact Form 7 form....

    [radio PRICE use_label_element "25" "50" "100" "Other"]             [submit "Continue"]

    This is the code I am using on the bottom of the actual donation page...

        function my_redirect() {
            var donate = document.getElementById('PRICE');
                   if (donate == 'other')
                        {  var url = 'http://www.google.com';
                               window.location = url;
            var url = 'https://www.paypal.com/us/cgi-bin/webscr?cmd=_donations&business=krashx6@gmail.com&item_name=Donation&currency_code=USD&amount='+donate+'';
            window.location = url;

    This is what I get when submitting the form no matter the selection...

    If I just copy/paste the var url into my browers "https://www.paypal.com/us/cgi-bin/webscr?cmd=_donations&business=krashx6@gmail.com&item_name=Donation&currency_code=USD&amount=50" putting any value for the price, it works fine. But through the form it gives that error.

    Also the other part is, why is my if statement not actually working? I just want it to forward to another url, but if they select other, nothing happens.

    Thanks for any help.

  2. krashx6
    Posted 2 years ago #

    I've tried moving the <script> from the actual wordpress page, to the Header, which still does not work :/

Topic Closed

This topic has been closed to new replies.

About this Topic