• avniy

    (@avniy)


    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 );
    • This topic was modified 4 years ago by avniy.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where on the site do you have the form having the issue?

    Thread Starter avniy

    (@avniy)

    Hey
    After you scroll down, you’ll have a floating envelope icon on the left bottom.

    The js code I added here is from all.js file in the theme’s directory.

    From my imperssion, the jQuery wp5.7 update broke something with cf7. Im having similar issues with more sites now.

    Ty!

    • This reply was modified 4 years ago by avniy.
    Plugin Author Takayuki Miyoshi

    (@takayukister)

    The js code I added here is from all.js file in the theme’s directory.

    What is the all.js supposed to do?

    Thread Starter avniy

    (@avniy)

    Hi
    See my first message. The code I added is in this file. (I mentioned that just in case you were looking for it in the website I linked to).

    As you probably guess, after submitting it should redirect according to the current window.location.href .

    It worked just until we updated CF7 to the latest version.

    Thank you.

    (Edit: I had to roll back to 5.3.2. Now it works)

    • This reply was modified 4 years ago by avniy.

    I have also experienced exactly same issue as @avniy, wpcf7mailsent stopped work.

    Form ajax sending doesn’t seems to work as well, redirecting back to the page after submission.

    Tried update to 5.4.2 but no dice.

    Revert back to 5.3.2 and works fine.

    • This reply was modified 3 years, 7 months ago by solidshek.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wpcf7mailsent + ajax stopped working’ is closed to new replies.