• Resolved mattmccomas

    (@mattmccomas)


    We use the free Event Tickets plugin. We been getting duplicate rsvp submissions.

    I can recreate the bug buy clicking on the ‘Confirm RSVP’ button on the event page multiple times quickly…I then end up with multiple RSVP’s from the same person in the system.

    Is there a way to fix this so that the Confirm RSVP button only registers one mouse click?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey there @mattmccomas!

    Thanks for reaching out.

    Give this snippet a shot in your child theme’s functions.php file:

    /**
     * Disable just the Submit button of the Event Tickets form after initial click to protect against sending data multiple times
     * From https://gist.github.com/cliffordp/8bceb54b440fbe9de1d42df6f231cc7a
     * By Matt B.
     * Updated 2017-01-13 for latest versions of ET/ET+
     **/
    function tribe_snippet_prevent_multi_click_on_submit() {
        wp_enqueue_script( 'jquery' );
        ?>
        <script>
        jQuery( function( $ ) {
            var $button = $( '.tribe-events-tickets-rsvp button[name="tickets_process"]' );
            $button.closest( 'form' ).on( 'submit', function( e ) {
                $button.on( 'click', function() { return false; } );
            } );
        });
        </script>
        <?php
    }
    add_action( 'event_tickets_rsvp_before_confirmation_fields', 'tribe_snippet_prevent_multi_click_on_submit' );

    Hey there,

    Since this thread has been inactive for a while, I’m going to go ahead and mark it as resolved. Don’t hesitate to create a new thread any time you help again!

    Ed 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Duplicate RSVP’s’ is closed to new replies.