• 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…

    <script>
        function my_redirect() {
            var donate = document.getElementById('PRICE');
                   if (donate == 'other')
                        {  var url = 'https://www.google.com';
                               window.location = url;
                        }
            var url = 'https://www.paypal.com/us/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donation&currency_code=USD&amount='+donate+'';
            window.location = url;
    }
    </script>

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

    If I just copy/paste the var url into my browers “https://www.paypal.com/us/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donation&currency_code=USD&amount=50&#8221; 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.

Viewing 1 replies (of 1 total)
  • Thread Starter krashx6

    (@krashx6)

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

Viewing 1 replies (of 1 total)
  • The topic ‘Contact Form 7 -> Paypal. need help with error.’ is closed to new replies.