Donation form broken - Can't switch back to credit card after selecting checking account

Options

Hello! On our donation forms (like this one), if you scroll down to the bottom payment method area and click on checking account, it correctly changes the fields to the appropriate ones. If you click back to credit card though, nothing happens and you're stuck with the checking account fields - it's a one-way trip.

Interestingly, I visited another organization's donation form (also based on Luminate) and noticed it had the same issue, so it must be at least somewhat common.

I assume something in the javascript is broken, and while I've got a decent working knowledge of js, I don't really know how luminate orders things on the back-end, nor where I should look to try and find the issue. Any chance someone can point me in the right direction, towards the code that handles this functionality? Thanks!

Tagged:

Comments

  • There seems to be an issue with the buttons not accurately checking the radio buttons that they're supposed to represent. What I've done in the past is add a script inside of an html caption at the bottom of the form. The script finds each button in the payment container and adds a click event listener. When the click is registered, the event listener calls a function to find the corresponding radio button and mark it as checked.

  • Colleen Gutierrez
    Colleen Gutierrez Blackbaud Employee
    Ancient Membership Facilitator 1 Name Dropper Photogenic

    Hi Nicholas -

    Would you be willing to open a case for that? If it's a bug, Support can route it so that the root issue gets resolved for everyone. Thanks for the catch, and sorry that is happening.

    Contact Blackbaud Support

    Thanks,

    Colleen

  • @Nicholas Birbilis ,

    The issue is a common occurrence on donation pages when the wrapper inserts a new version of jQuery and does not rely on the one provided by Luminate (v.1.6). The root cause is the combination of HTML markup that is less than ideal (<label><a></a></label>) and the jQuery versions. When a user clicks on a label, they are actually clicking on a link, which does not produce any results.

    On your donation page, the newer jQuery is inserted, thus causing this same issue. We found that the best solution is to update HTML with JavaScript to remove the link and let the labels do the toggling.

    Here's a function that use on donation forms on page load that achieve this and prevents issues.

    Hope this helps

    /**
    * Fixes the payment methods toggle, as higher versions of jQuery breaks
    * Luminate default functionality
    * @param {jQuery Object} $form donation form object
    * @return {jQuery Object} donation form object
    */

    function fixPaymentMethodToggle($form) {
    var $labels;
    var $paymentOptions = $form.find('.payment-type-option');

    // assign values to variables
    $labels = $paymentOptions.find('label');

    // remove inner link from within the label, so it doesn't block the default JS firing
    $labels.each(function (index, element) {
    var $label = $(element);
    var $link = $label.find('a');

    $label.html($link.html());
    });

    return $form;
    }

  • Thank you for the help! Sorry for the late response, but this is making sense. Looks like our form works properly now, and I'm not sure if that's because I managed to tinker with it before or if some update was somehow pushed that affected it for us. This approach is helpful for some other tweaks I was looking to make in the future too, so I appreciate it.

Categories