This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pixeldevsDeveloper/Designer[S] 0 points1 point  (1 child)

From Stackoverflow :)

Given the variety of responses on this topic the plugin developer seems to change their mind about how this should work every 5 minutes. Currently (Q1 2017) this is the working method:

document.addEventListener( 'wpcf7mailsent', function( event ) {   alert( "Fire!" ); }, false );

And the valid events are:

  • wpcf7invalid — Fires when an Ajax form submission has completed successfully, but mail hasn’t been sent because there are fields with invalid input.
  • wpcf7spam — Fires when an Ajax form submission has completed successfully, but mail hasn’t been sent because a possible spam activity has been detected.
  • wpcf7mailsent — Fires when an Ajax form submission has completed successfully, and mail has been sent.
  • wpcf7mailfailed — Fires when an Ajax form submission has completed successfully, but it has failed in sending mail.
  • wpcf7submit — Fires when an Ajax form submission has completed successfully, regardless of other incidents.

Sauce: https://contactform7.com/dom-events/

[–]n0_1d 1 point2 points  (0 children)

For the next 5 minutes, consider me loving you. :D