PopUp will not closed after submit

Hi there,

Great Plugin, I love it :slight_smile:. But one Problem:
the PopUp on http://www.torstenwill.com will not closed after I click on "Absenden" (english = submit). What can I do?

Thank you!

Greetings,
Sebastian

  • Sebastian

    Hi Patrick,

    thank you for your fast answer!

    Please take a look to the end to see the code from the form.
    That should do the following after user click on "absenden" (submit):

    - open page from the newsletter provider (It works)
    - close the PopUp ans never show again
    - for "close the PopUp" - It´s not working.
    - for "never show again" - there is a checkbox in the PopUp options; But i have not tryed.

    Have you an Idea?

    Greetings,
    Sebastian

    ##### FORM CODE BEGIN #####

    <div>
    <form id="subscribeform" action="http://007.frnl.de/box.php" method="post" target="_blank" >
    <table border="0" width="300" cellspacing="3" cellpadding="0">
    <tbody>
    <tr>
    <td>
    <p class="Body"><span class="C-31">Vorname</span></p>
    </td>
    <td valign="top"><input name="field[2531,0]" type="text" value="" /></td>
    </tr>
    <tr>
    <td>
    <p class="Body"><span class="C-31">Name</span></p>
    </td>
    <td valign="top"><input id="name" name="name" type="text" /></td>
    </tr>
    <tr>
    <td>
    <p class="Body"><span class="C-31">E-Mail</span></p>
    </td>
    <td valign="top"><input id="email" name="email" type="text" /></td>
    </tr>
    <tr>
    <td>
    <p class="Body"><span class="C-31">Empfohlen von</span></p>
    </td>
    <td valign="top"><input name="field[2532,0]" type="text" value="" /></td>
    </tr>
    <tr>
    <td>
    <div style="text-align: right;"><input id="p" name="p" type="hidden" value="1674" />
    <input name="funcml" type="hidden" value="add" />
    <input name="nlbox[1]" type="hidden" value="4002" /></div></td>
    <td><input name="Speichern" type="submit" value="Anmelden" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </div>

    ##### FORM CODE END #####

  • Sumit Kumar

    Hello @Sebastian,
    Thanks for posting down the popup content here :slight_smile:

    I copied it to my setup and do replicate the same behavior. I then checked it in browser's console window and it generates a Javascript error there. This can be a bug. :slight_smile:

    Let me call here our developer @Philipp Stracker for his feedback. It was only in this version, that the form submit functionality is added and I think the form submit behavior in new tab is not considered... :wink:

    So, lets wait for his feedback. Generally, developers feedback are not at-the prompt than our usual response. Therefore, we request your patience here.

    Have a nice time :slight_smile:
    Warm Regards,
    Sumit

  • Sumit Kumar

    Hey Sebastian,

    I told you earlier, these developer guys are real busy dudes..., well, he just forwarded me few lines of codes and then went back for his weird coding stuffs...on usual routine :slight_smile: :wink:

    Never Mind, so here's the code:

    <script type="text/javascript">
    jQuery(document).ready(function($) {
       jQuery('form').submit(function(){
    	for( key in inc_popups ) {
    		var item = inc_popups[key];
    		var data = item.extend.data;
    		// To close any open popup remove the condition...
    		if ( data.popup_id == 1729 ) { //use your own popup_id here
    			item.extend.close_popup();
    		}
    	}
    	});
    });
    </script>

    You know where to put these stuffs right. Either place them in footer files of your child theme or use this plugin: https://wordpress.org/plugins/header-footer/

    (P.S. the popup_id should be your plugins "popup_id". You can find them from the respective popup's url or while hovering over the list of popups in backend.) Screenshot attached. :slight_smile:

    Also, a message from our developer: "We will change this in the next version: The Redirect-Form action will *always* close the popup (might be 1-2 weeks until the update)"... :slight_smile:

    I tested in my end and it worked for me. Let us know if you stumble upon it.

    Regards, Sumit

  • Andre Foisy

    Hello there @Sebastian,

    I hope your day is great!

    I'm sorry to see this issue you're having at the moment.

    After, your last reply here above, I went into your dashboard and tried and tested the temporary code snippet you've got from the developer here above.

    I've removed the code you added to your footer.php and tried with the Header Footer plugin you had installed as well. I've also changed the popup ID in the jQuery code, because it was not the same as in your test.

    I've also tested the form without the target= " _blank " value and nothing works as it should.

    Right now, it looks like the developer is working on the issue and I believe your best bet would be to look forward for a complete fix in a coming update.

    I re-quote here from our developer, in case you've missed it: "We will change this in the next version: The Redirect-Form action will *always* close the popup (might be 1-2 weeks until the update)" ... :slight_smile:

    Meanwhile, do not hesitate to come back if you need anything else, it'll always be a pleasure to help.

    Warm regards,
    Andre

  • Philipp Stracker

    HI Sebastian,

    I just made the changes in the javascript file to close the PopUp automatically after the form is submitted.
    Since this change is very small and you granted us support access I could copy the modified file to your installation - so the issue should be solved for you :wink:

    The PopUp is closed when you click the Absenden button for the newsletter form.

    However, what I noticed is the multi language plugin that allowed you to create a german and an english popup. Currently both popups are loaded on the page... To solve this I suggest to use the "(Not) On approximate URL" rules:

    German PopUp:
    Not On approximate URL "?lang=en"

    English PopUp
    On approximate URL "?lang=en"

    Hope this could solve your issues :wink: Philipp

  • Michael Bissett

    Hi @Sebastian,

    Looking at things over here (on my Windows 8.1 PC), it seems that when switching from one language to another (e.g. from German to English), you have to click the flag for the language twice in order to get the correct popup to load (you'd click the flag for the 2nd time after the page reloads).

    I've called my colleague @Ashok back to this thread, so that he can provide his insight on the matter. :slight_smile:

    Kind Regards,
    Michael

  • Sebastian

    Hi Ash,

    I have checked. I don´t have any cash plugin in my WordPress installation. Varnish? No, I think not.

    I have testet on different Computers. Also on the Computer in my office (he don´t have seen this page before). No PopUp :slight_frown:. A Friend of me have the same problem.

    If I see the PopUp, I click on "Absenden" - that works fantasticly :slight_smile:.
    But the PopUp comes only sometimes. And I don´t now why :slight_frown:.
    What can we do?

    Greetings,
    Sebastian

  • Michael Bissett

    Hey @Sebastian,

    It sounds like we'll need to do some deeper digging here, could you please send in the following:

    - 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
    - Include FTP log-in details
    - Include any relevant URLs for your site

    On the contact form, 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

  • Michael Bissett

    Hey @Sebastian,

    Actually, hold off, I just had a talk with the developer, and narrowed down the problem here. :slight_smile:

    To paraphrase:

    I moved all English popups to the trash and created a new English popup that I linked with the default German popup (using the WPML meta-box). Then I changed all settings for the German/English popups individually and it was working.

    The problem was, there were two popups created for English and German, but the popups were not linked together. Because of this, there were duplicates of each popup that had wrong settings.

    Could you please check on your end now, and see if everything's working as it should? :slight_smile:

    Please advise,
    Michael

  • Michael Bissett

    Hey @Sebastian,

    Could you elaborate on how you're viewing the site on mobile? (e.g. the device in question, what operating system was running, what version of the OS, what browser was being used)

    I was able to see the popup on my end if Firefox was being used on a Android tablet running Android 4.4.

    Also, have you tried clearing the cache inside of the browser on your tablet?

    Please advise,
    Michael