Last active
March 1, 2018 18:06
-
-
Save petertwise/7d0ebe2985ef6f6ac7dbfa70606f2722 to your computer and use it in GitHub Desktop.
Contact Form 7 - thank you page per form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener( 'wpcf7mailsent', function(event) { | |
// console.log(event.detail.contactFormId, event); | |
switch( event.detail.contactFormId ) { | |
case "1234": | |
// thank you page for form ID 1234 "My Form 1" | |
location='https://example.com/form1/thank-you/'; | |
break; | |
case "1235": | |
// thank you page for form ID 1235 "My Form 2" | |
location='https://example.com/form2/thank-you/'; | |
break; | |
default: | |
// default thank you page for all other forms | |
location='https://example.com/thank-you/'; | |
break; | |
} | |
}, false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment