• Resolved disturbed-pixel

    (@disturbed-pixel)


    Hi hwk-fr,

    I’ve encountered an issue that when our forms are being submitted, we’re receiving several identical form entries. We think the user is being impatient and clicking submit several times or refreshing the page.

    Do you have any tips on how to prevent this?

    Initially i was going to try and disable the submit button after a successful validated submission via Javascript, but is there a submit hook to allow only one submission per form?

    Thanks for your help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback! ACF Extended Forms use the native ACF Form JS (due to forms JS processing validation & submission the same way) and adds its own logic on top of it for advanced features.

    The problem you’re facing is related to the ACF Form way to lock/unlock forms during its submission. ACF will prevent any additional click on the submit button during the Ajax Validation, but not once it’s validated and submitted. This is why some users can successfully click spam the button during the page reload and thus, generate multiple posts.

    In order to avoid that behavior, you can add the following JS code in your theme:

    // Prevent form submission click spam
    $('.acfe-form .button, .acfe-form [type="submit"]').click(function(e){
    
        if(!$(this).hasClass('disabled'))
            return;
    
        e.preventDefault();
    
    });
    

    I’ll add that fix in the next ACF Extended patch, and also open a feature request on the official ACF repo, since it’s a global enhancement of ACF Forms behavior.

    Hope it helps!

    Regards.

    Thread Starter disturbed-pixel

    (@disturbed-pixel)

    Makes complete sense.

    That’s perfect thanks Hwk-fr!! As per usual top notch support and help ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Stop multiple submissions’ is closed to new replies.