wpcf7mailsent + ajax stopped working
-
A sample script that used to work before not working anymore after the latest wordpress 5.7 + cf 5.4 update.
The page reloads with the form #id and the event is not firing anymore.
document.addEventListener( 'wpcf7mailsent', function( event ) { if ( event.detail.contactFormId == '1559' ) { setTimeout(function() { $(".floating-left").removeClass("active") }, 2000); } console.log(window.location.href.toLowerCase().indexOf("/ast/")); console.log(window.location.href.toLowerCase()) if (window.location.href.toLowerCase().indexOf("/ast/") > -1) { document.location.href="/group/ast/thank-you/"; } else if (window.location.href.toLowerCase().indexOf("/toxsorb/") > -1) { document.location.href="/group/toxsorb/thank-you/"; } else if (window.location.href.toLowerCase().indexOf("/rotec/") > -1) { document.location.href="/group/rotec/thank-you/"; } else if (window.location.href.toLowerCase().indexOf("/triple-t/") > -1) { document.location.href="/group/triple-t/thank-you/"; } else { document.location.href="/thank-you/"; } //jQuery("#thankyou-overlay").fadeIn(); }, false );
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘wpcf7mailsent + ajax stopped working’ is closed to new replies.