Redirect after validation ok
-
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.
- The topic ‘Redirect after validation ok’ is closed to new replies.