• Resolved plavalle

    (@plavalle)


    After reading the documentation on redirecting to a thank you page, I found that even if there are required fields in the form that have not been filled out, the form still redirects.

    I cannot locate in your documentation on how to handle validation, then redirect on wpcf7-mail-sent-ok.

    Can you please explain what should be done.

    My client has seven forms all redirecting to a separate thank-you page, I created functions based on the click event, otherwise errors were produced for the functions that you suggested.

    The basic function is below:

    jQuery(‘#tstmnl-thk-you .wpcf7-form-control’).click(function(){
    var wpcf7Elm_Tstmnl = document.querySelector( ‘#tstmnl-thk-you #wpcf7-f3906-p3462-o1.wpcf7’ );
    wpcf7Elm_Tstmnl.addEventListener( ‘wpcf7submit’, function( event ) {
    location = ‘https://mydomain.com/redirect-thank-you/’;
    }, false );
    });

    Up until this point, I had great success in customizing contact-form-7 forms.

Viewing 1 replies (of 1 total)
  • Thread Starter plavalle

    (@plavalle)

    Never mind found what I should do. Replaced wpcf7submit with wpcf7mailsent so validation can happen and submit only when ok

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect after validation ok’ is closed to new replies.