PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Numerous instances of Multiple Charges - NEED HELP!! - Refunding lots of charges

  1. I need help quick! I run a non-profit organization website where people submit their application and then submit a donation along with it. The form is 6 pages long. the final page has the payment through authorize.net. We are getting several instances of people being charged multiple times.

    This started a couple weeks ago when I changed our site into a multi-site wordpress structure. Could you please help!

    I will email the site URL. Dont want it up on the forum

    Posted 11 years ago on Saturday April 13, 2013 | Permalink
  2. I would disable the submit button after the form is submitted, using this code:

    http://pastebin.com/TR1Lu7Tb

    That will limit or prevent multiple form submissions by impatient users, or users who do not realize the form is being processed.

    Posted 11 years ago on Sunday April 14, 2013 | Permalink
  3. Where would I put this code?

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  4. David Peralty

    It would go in your theme's functions.php file.

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  5. I added the code to my functions.php file and got this error....

    Warning: Cannot modify header information - headers already sent by (output started at /xxxhiddenxxx/wp-content/themes/Webly/functions.php:82) in /xxxhiddenxxx/html/wp-includes/pluggable.php on line 876

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  6. David Peralty

    Did you remove the <?php call from the first line? Your functions file probably already has the opening call for PHP.

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  7. Just tried it and got a new error. Would you like me to paste my functions file?

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  8. David Peralty

    Yes, please paste it on pastebin and link it here.

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  9. http://pastebin.com/qEPZdeNR

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  10. David Peralty

    I don't see the snippet that you were given in that file. What error are you seeing currently?

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  11. We get applications constantly throughout the day so I deleted the suggested snippet because people couldnt get to the application. I was hoping you could point out where I need to put the code.

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  12. David Peralty

    Put line 2 - 23 of our snippet in line 28 of yours.

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  13. Inserted the code and tested the form. It works! One more question, what would I do if I wanted to do the same thing for another form on our system?

    Thanks for the help!

    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  14. David Peralty

    You would add another filter with the form number changed:

    add_filter('gform_pre_render_116', 'disable_submit');
    Posted 11 years ago on Thursday April 18, 2013 | Permalink
  15. wordpressuser
    Member

    If I understand what you are saying for disabling the submit button on submission action on multiple forms.... should it look like the following?

    add_filter('gform_pre_render_ID#1', 'disable_submit');
    add_filter('gform_pre_render_ID#2', 'disable_submit');
    add_filter('gform_pre_render_ID#3', 'disable_submit');
    function disable_submit($form) {
        ?>
    
        <script type="text/javascript">
        jQuery(document).ready(function($){
            $('#gform_submit_button_<?php echo $form['id']; ?>').on('click', function(event){
    
                var submitCopy = $(this).clone();
                submitCopy.prop('id', '').prop('disabled', true).prop('value', 'Processing...').insertAfter($(this));
    
                $(this).hide();
    
            });
        });
        </script>
    
        <?php
        return $form;
    }

    Is there a way to make the default function for all forms?

    Posted 11 years ago on Saturday April 20, 2013 | Permalink
  16. Richard Vav
    Administrator

    To make the function apply to all forms you would remove the form id from the end of the hook name like so

    add_filter('gform_pre_render', 'disable_submit');

    Regards,
    Richard
    --
    Just another member of the community helping out where I can

    Posted 11 years ago on Saturday April 20, 2013 | Permalink