Hi, Jetpack contact forms do not use AJAX for submission. Instead they use the old-fashioned way of POSTing directly to the page. This means the complete page is reloaded on form submission and it’s not FancyBox that is closing but the complete web page is refreshed and opens (as always) without a FancyBox lightbox.
There is however, a way to make FancyBox open on page load and with the exact combination of triggers and ID’s, it might be possible to launch FancyBox right after a Jetpack form has been submitted, displaying the submission result/feedback.
If you can share a link to your site, I might be able to give you a code snippet to try.
Try adding the following snippet to a text widget or anywhere else in the page.
<a href="#contact_form_pop" id="pop_after_submit" class="fancybox"></a>
<script type="text/javascript">
window.onload = function() {
if(location.hash == "#contact-form-68") {
jQuery('#pop_after_submit').trigger('click');
}
};
</script>
Thanks RavanH it works!!! 😉
Ps: i found this post:
https://wordpress.org/support/topic/plugin-jetpack-by-wordpresscom-2-questions-about-contact-form?replies=10
Do you think it’s possible to transform Jetpack Contact Form in AJAX with an external plugin? O_o
Thanks for the help dude.
Well you could just try installing https://wordpress.org/plugins/grunion-ajax/ and see if that still works as it did 3 years ago…