how to enable ajax on submitting of contact form 7?

Actually i am try to show the short code of contact form 7 in the popup window . but the The form appears in the popup window when i submit the form page loads. i want to stop the page after submitted and show success message on popup.

Topic plugin-contact-form-7 ajax Wordpress

Category Web


Not sure about ajax, but you could use a custom DOM event to run some javascript...

From the "contact form 7" documentation:

The simplest way is utilizing Contact Form 7’s custom DOM event to run JavaScript. The following is an example of script that redirects you to another URL when the wpcf7mailsent event occurs:

<script>
  document.addEventListener( 'wpcf7mailsent', function( event ) {
    location = 'http://example.com/';
  }, false );
</script>

Redirecting to Another URL After Submissions

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.