Contact Form 7 AJAX Callback

In version 3.3 new jQuery custom event triggers were introduced:

New: Introduce 5 new jQuery custom event triggers

  • wpcf7:invalid
  • wpcf7:spam
  • wpcf7:mailsent
  • wpcf7:mailfailed
  • wpcf7:submit

You can use wpcf7:invalid like the example below:

$(".wpcf7").on('wpcf7:invalid', function(event){
  // Your code here
});

Leave a Comment