Setting PayPal Parameters - TypeError: a.getAttribute is not a function
Last Post 12-22-2012 09:50 AM by Chris. 6 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages Resolved
ChrisUser is Offline
going with the flow
going with the flow
Posts:29
Avatar

--
12-21-2012 09:08 AM
    I am setting up recurring payments with PayPal and attempting to set parameters as described here: Implementing PayPal Subscriptions w/ Dynamic Forms

    There seems to be a javascript issue in referencing the radio field because when the page loads, the default radio button is not selected and I get the error, "TypeError: a.getAttribute is not a function", and I get the same error when the radio buttons are clicked which results in the parameters never getting updated.

    Here is an example of the parameters are I am trying to add, "&a3=79.00&t3=M"

    And here are my additional parameters, "&p3=1&src=1&no_note=1¤cy_code=USD&item_name=g-bit_Subscription&no_shipping=1&first_name=$(FirstName)&last_name=$(LastName)&email=$(Email)"

    Best,
    Chris
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    12-21-2012 09:13 AM
    Hi Chris,

    Would you please enable debug and then fill out the form and hit submit? Please post the resulting debug string so we can see what values are being replaced by your tokens. Thanks!

    Candace
    ChrisUser is Offline
    going with the flow
    going with the flow
    Posts:29
    Avatar

    --
    12-21-2012 09:56 AM
    Sure, here it is:

    https%3a%2f%2fwww.sandbox.paypal.com%2fcgi-bin%2fwebscr%3fcmd%3d_xclick-subscriptions%26business%3dcfguid_1355765894_biz%40gmail.com%26cancel_return%3dhttp%3a%2f%2flocalhost%2fHome%2fSubscribe-PayPal%2fPayPalReturn%2fTrue%2fPayment%2fCancelled%2fPayPalReturnID%2f738273ad-748f-4d57-8984-54578cddfe4a%2fDynamicModuleID%2f637.aspx%26notify_url%3dhttp%3a%2f%2flocalhost%2fHome%2fSubscribe-PayPal%2fPayPalReturn%2fTrue%2fNotify%2fIPN%2fPayPalReturnID%2f738273ad-748f-4d57-8984-54578cddfe4a%2fDynamicModuleID%2f637%2fOrgUserID%2fcfguidry.aspx%26Debug%3dTrue%26return%3dhttp%3a%2f%2flocalhost%2fHome%2fSubscribe-PayPal%2fPayPalReturn%2fTrue%2fPayment%2fSucess%2fPayPalReturnID%2f738273ad-748f-4d57-8984-54578cddfe4a%2fDynamicModuleID%2f637.aspx%26p3%3d1%26src%3d1%26no_note%3d1%26currency_code%3dUSD%26item_name%3dg-bit_Subscription%26no_shipping%3d1%26first_name%3dChris%26last_name%3dGuidry%26email%3dcfguidry2%40gmail.com Debug Mode, PayPal URL:https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=cfguid_1355765894_biz@gmail.com&cancel_return=http://localhost/Home/Subscribe-PayPal/PayPalReturn/True/Payment/Cancelled/PayPalReturnID/738273ad-748f-4d57-8984-54578cddfe4a/DynamicModuleID/637.aspx¬ify_url=http://localhost/Home/Subscribe-PayPal/PayPalReturn/True/Notify/IPN/PayPalReturnID/738273ad-748f-4d57-8984-54578cddfe4a/DynamicModuleID/637/OrgUserID/cfguidry.aspx&Debug=True&return=http://localhost/Home/Subscribe-PayPal/PayPalReturn/True/Payment/Sucess/PayPalReturnID/738273ad-748f-4d57-8984-54578cddfe4a/DynamicModuleID/637.aspx&p3=1&src=1&no_note=1¤cy_code=USD&item_name=g-bit_Subscription&no_shipping=1&first_name=Chris&last_name=Guidry&email=cfguidry2@gmail.com
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    12-21-2012 10:03 AM
    • Accepted Answer
    Thanks, Chris.

    At the very end of the string, we see this:

    .aspx&p3=1&src=1&no_note=1¤cy_code=USD&item_name=g-bit_Subscription&no_shipping=1&first_name=Chris&last_name=Guidry&email=cfguidry2@gmail.com

    That tells me that you're not using the token for the radio button in your parameters. If your radio button has option values like &a3=79.00&t3=M, then please add $(RadioButton)&p3=1&src..... Note that you need to use the short name of the radiobutton in the token.

    Please try it and let me know what happens. Thanks!

    Candace
    ChrisUser is Offline
    going with the flow
    going with the flow
    Posts:29
    Avatar

    --
    12-21-2012 11:18 AM
    Ah, from the example I could not tell that I needed to add that to the additional parameters. That problem is solved. Thanks!

    However, I am still getting that same javascript error message. It doesn't prevent the payment process from working, but the default value is not getting set. I have chosen a default value, checked the option for "Always Force Default Value" and unchecked the "No default value" option. The error occurs anytime the page is reloaded or one of the radio options is clicked.
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    12-22-2012 04:13 AM
    Glad to hear that the first issue is resolved.

    I wouldn't recommend that you check "always force default value" in your case. If you want a default selection, uncheck the no default value and then mark the option you want that appears under this setting.

    Thanks!
    Candace
    ChrisUser is Offline
    going with the flow
    going with the flow
    Posts:29
    Avatar

    --
    12-22-2012 09:50 AM
    Candace - I tried doing that as well, but still the default value was not selected and that js error continues to pop up in Firefox. Anyway, I marked the field as required and I am not going to worry about it for now.


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi