• Hi everyone,
    my form takes a while to submit (as the user needs to upload documents as well) and if they click “send” multiple times I receive multiple identical submissions, which should not be the case.

    I found an old discussion in which they suggested to paste the following code to disable the send button after clicking, but I had no luck. I am using CF7 with CF7 Conditional Fields and CFDB to save into the DB.

    Hope someone can give a specific advice on how to prevent this or another kind of workaround. My users should be able to send different forms periodically, more than once per user, but not just because they double-click send by mistake.

    Thanks a lot!
    —————–
    I am using PHP 5.7 (but also tried with 7.0, as 7.1 broke the plugin), I pasted this both in CF7 scripts file (in /includes) and in CF Conditional Fields scripts file as well – not sure if I need to recall it somewhere else or what.

    var disableSubmit = false;
    jQuery(‘input.wpcf7-submit[type=”submit”]’).click(function() {
    jQuery(‘:input[type=”submit”]’).attr(‘value’,”Sending…”)
    if (disableSubmit == true) {
    return false;
    }
    disableSubmit = true;
    return true;
    })

    var wpcf7Elm = document.querySelector( ‘.wpcf7’ );
    wpcf7Elm.addEventListener( ‘wpcf7submit’, function( event ) {
    jQuery(‘:input[type=”submit”]’).attr(‘value’,”send”)
    disableSubmit = false;
    }, false );

The topic ‘Double submissions’ is closed to new replies.