Pop Up Pro wont close on submit in subscribe form.

I have a Pop Up that is designed as a sign up form. It was all working until I updated Pop up Pro. Now it stays open and I can't close it

  • Tyler Postle

    Hey Justpixelsau,

    Hope you're doing well today and thanks for your question!

    Can you try changing the loading method for your pop up via:

    Popup Pro > Settings.

    Try the different loading methods and see which one works best for you :slight_smile:

    If it's still not working then do you mind linking to a page where I can see this Pop Up? I went to your site but wasn't sure which conditions you had to activate the pop up.

    Look forward to hearing back here!

    All the best,
    Tyler

  • Tyler Postle

    Hey Jerome,

    Hope you're doing well today and thanks for getting back to me :slight_smile:

    I just took a look on your site and I was able to close the pop up without any issues. I tested it in Chrome, Firefox, and Internet Explorer browsers.

    Can you clear your browsing cache then try again? Which browser are you using?

    Look forward to hearing back!

    All the best,
    Tyler

    PS. I was able to close it both by clicking the "X" and also by just clicking outside the Popup.

  • justpixelsau

    Sorry. I didn't actually make my question clear. Really sorry about that. The x works and so does clicking outside the circle. My issue is, when you press submit, I want it to close and the person is now subscribed. This was working by attaching the code in my last post to the submit button, but now that doesn't work. I can see the coding on that div has changed and that the surrounding div is now a random string every load that starts with an a. Any advice?

  • Philipp Stracker

    Hi Jerome,

    we have reviewed the issue and found the issue and a solution.
    There will be an update of PopUp Pro in the next days that includes this change:

    When a form is included in the PopUp we now have improved monitoring of the form status. Once the form is submitted 3 actions can happen:

    1. It is a "normal" Form that submits to the current pages URL. In this case the PopUp contents are updated once the form submit is completed

    2. The form submits to a different URL (or external URL). In this case we cannot refresh the PopUp and close the PopUp once the submit is completed. We cannot display a success/error message

    3. The form is submitted via Ajax (this is the case on your test site): This is same as action 2 -> We have no idea what the result of the form submit is, so the popup will be closed after the data is submitted. It is not possible to show a success or error message.

    In your current version of PopUp the options 1 and 2 already work, but for Ajax submits (3; your site) the PopUp would stay open and display the loading animation forever.

    Though I know it's not optimal to close the PopUp on submit it's not possible for us to know if the form submit was working or if there is an error that should be displayed to the user...

    Hope this solution works for you :slight_smile:
    Thanks, Philipp

  • Philipp Stracker

    Btw, we integrate a javascript hook in version 4.6.1.4 that allows you to manually check and handle Ajax responses of your PopUps! Have a look at this example code:

    <script>
    jQuery( document ).on( 'popup-submit-done', function( event, popup, data ) {
    	console.log( data.popup_id );  // Shows the internal PopUp-ID
    	console.log( data.last_ajax.responseJSON ); // Response of the most recent Ajax call (JSON object)
    	console.log( data.last_ajax.responseText ); // Response of the most recent Ajax call (plain text)
    
    	// Example:
    
    	// Only check the Ajax response of PopUp ID 18
    	if ( data.popup_id === 18 ) {
    		// We check if the ajax response has property "message_sent = false"
    		if ( false == data.last_ajax.responseJSON.message_sent ) {
    			// If the message was not sent we keep the PopUp open:
    			data.close_popup = false;
    		}
    	}
    });
    </script>
  • Michael Bissett

    Hey @justpixelsau,

    While we're waiting for Philipp here (developers tend to be very busy folk :slight_smile: ), could I ask you to send in the following for your site via our contact form:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Mention where you've placed your jQuery code
    - Include any relevant URLs for your site

    On the contact form (linked to below), please select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thanks a bunch! :slight_smile:

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.