Contact Form 7
Contact Form 7 -> Paypal. need help with error. (1 post) (1 post)

  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"]

    In additional Settings I have....
    on_sent_ok: 'my_redirect();'

    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.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.