1. Home
  2. Knowledge Base
  3. Divi Areas Pro
  4. Snippets
  5. Contact Form 7 – show Popup after submit

Contact Form 7 – show Popup after submit

CF7 offers some JavaScript events that we can hook into. Using those events, we can create a small snippet to open a Popup after a successful contact form submission:

<script>(function ($) {
	DiviArea.addAction('ready', function () {
		$('.wpcf7').on('wpcf7submit', function (event) {
			// Status "mail_sent" means, that the form submit is complete.
			if ('mail_sent' === event.detail.status) {
				DiviArea.show('#after-submit'); // ← Change this to your Popup ID.
			}
		});
	});
})(jQuery);</script>

→ Open in the Script Generator

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support