TransWikia.com

how to enable ajax on submitting of contact form 7?

WordPress Development Asked by Muhammad Ishaq on December 10, 2021

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.

One Answer

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

Answered by Trevor J on December 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP