Pop Up Pro & Contact Form 7 AJAX Issue

Hopefully someone can help shed some light on an issue I have been having on this website. I am using a Contact Form 7 shortcode inside of a Pop-Up Pro. When a user clicks on the image that says "Click to view our 25 year success record" the pop-up is triggered using the class reqbrochure.

I have no problem triggering the pop-up initially, however something is stopping the Contact Form 7 from being able to refresh using AJAX. So, when someone submits the form, the page refreshes no matter whether the form input was valid or invalid. This means the user has to click on the image again to see any feedback. Obviously this won't work.

So, first, I would like to know if there is a relatively easy way for me to resolve this AJAX issue so that when the popup loads via WordPress AJAX, the Contact Form can also use AJAX to submit.

I have disabled and tested all plugins, they are not causing any conflict. There is a possibility that the issue lies within the theme, but no console errors are showing and I wouldn't know where to start if this was the issue.

If there isn't an easy way to do that, then I would like some advice on how I can get around the issue by prompting the pop-up to reopen if the URL includes the string #wpcf7 (which it does if there is an error sent). Here is what I have tried so far:

<script>
jQuery(window).load(function() {
    if(window.location.href.indexOf("#wpcf7") > -1) {
        // alert("found it");
        jQuery('#puerror').click();
    }
});
</script>

I have a second pop-up created with the same settings, but it responds to the ID selector "#puerror", which is a hidden button on the page. I tested that the button is being clicked by adding an onClick alert. The code above will click the button if it finds the string in the URL. However, no matter what I try, the pop-up does not show up.

That's all I know to do, and it's not working. I have enabled support access for the site too, so please feel free to go and look/tweak anything.

Any help would be really appreciated! Thanks :slight_smile: