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

  • Patrick
    • Support Monkey

    Hi there @Sebastian

    Welcome to the forums, glad to have you aboard!

    It looks like the popup is not reacting to your form submit button because it is redirecting the user to another, offsite, URL after being clicked.

    Are you using a shortcode from some other plugin to display that form? If so, which plugin is it?

    Perhaps we can help you tweak your form settings or shortcode parameters.

  • Sebastian
    • WPMU DEV Initiate

    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
    • Site Builder, Child of Zeus

    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
    • Site Builder, Child of Zeus

    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

  • Sebastian
    • WPMU DEV Initiate

    Hi,

    thank you for the code. I have insert. And I´m sorry, but it dosen´t work :slight_frown:
    Please take a look in the attachment. What´s wrong?

    what to do ?
    - User click on "absenden" (submit)
    - a Page open in a new windows "thank you for newsletter registration"
    - the popup sould be closed

    thank you and greetings,
    Sebastian

  • Andre Foisy
    • The Incredible Code Injector

    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
    • The Crimson Coder

    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

  • Sebastian
    • WPMU DEV Initiate

    Hi Philipp,

    thank you, great :slight_smile:.
    - Is something to consider when I updating the plugin?
    - You write about a rule like "Not On approximate"; But in the PopUp-Tool i will find only the following. Is this the right?
    On specific URL
    Not on specific URL

    Greetings from germany,
    Sebastian

  • Ash
    • WordPress Hacker

    Hello @Sebastian

    I hope you are well today.

    #1. We can't confirm about this, as the issue is little uncommon but I believe @Philipp Stracker will keep that in mind :slight_smile:

    #2. You need to enable Advanced URL add on from Popup > Settings :slight_smile:

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Ash
    • WordPress Hacker

    Hello @Sebastian

    I hope you are well today.

    I can see ?lang is not set in your site url. It does change the language but I think it uses cookies.

    Which plugin you are using to make the site multilingual? Also, would you please enable support access?

    Cheers
    Ash

  • Ash
    • WordPress Hacker

    Hello @Sebastian

    Do you have any cache installed in your server like varnish?

    I have deactivated all popups but it always shows the Startseite popup.

    Also, I have setup two popups based on assumption for two language, they are inactive now.

    Would you please let me know about Startseite popup?

    Cheers
    Ash

  • Sebastian
    • WPMU DEV Initiate

    Hi Ash,

    sorry, but I´m a little bit horrified. I checked my website and on Firefox I see a error. On Google Chrome I see a big popup, if is activated. Please take a look in te attachment.

    Note: Because of this error, the popup ist NOT activated at the moment.
    What´s happend?

    Greetings,
    Sebastian

  • Ash
    • WordPress Hacker

    Okay please check now. Now the popup shows based on active language.

    Used code:

    <div style="display: none">
    <p class="pop_en">click</p>
    <p class="pop_de">click</p>
    </div>
    <script type="text/javascript">
    jQuery(function($) {
    	setTimeout(function() {
    		$('.pop_<?php echo $_COOKIE['_icl_current_language'] ?>').click();
    	}, 1000);
    });
    </script>

    Please check and let us know.

    Cheers
    Ash

  • Michael Bissett
    • Recruit

    Hi @Sebastian,

    What my colleague @Ashok meant by "active language" was that if the user viewing the German language version of the site (for instance), then the German language popup will display.

    If the user happens to be viewing the English language version of the site, then the English language popup will display. :slight_smile:

    Hope this helps!

    Kind Regards,
    Michael

  • Sebastian
    • WPMU DEV Initiate

    Hi Michael,

    thank you! Ok, i have tested. But on my pc - and on a other pc, german page = german pupup -> great.

    But on the english page I see also the german popup. On all browser - but not on the iphone. On iPhone I can see the german on german and the english on english.

    What do you think? It´s a wordpress/plugin or a cache-problem?

    Greetings,
    Sebastian

  • Michael Bissett
    • Recruit

    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

  • Ash
    • WordPress Hacker

    Hello @Sebastian

    I think this is a cache issue. Do you have any caching plugin installed? Or even do you have any cache in your server like Varnish?

    If yes, please delete cache and disable cache and check.

    Also, delete the browser cookies.

    Cheers
    Ash

  • Sebastian
    • WPMU DEV Initiate

    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
    • Recruit

    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
    • Recruit

    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

  • Sebastian
    • WPMU DEV Initiate

    Dear Michael,

    first, sorry for the late anwer. I have checked it. Great :slight_smile:. Thank you - it´s working :slight_smile:. But the popup "only on mobile devices is not working. Please, can you take a look?

    Thank you and Greetings,
    Sebastian

  • Michael Bissett
    • Recruit

    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

  • Sebastian
    • WPMU DEV Initiate

    Dear Michael,

    thank you for your answer and happy holidays to you :slight_smile:.
    I have checked on different devices. Yes, I think also it was a "cache" problem.
    Thank you for your fast and good support guys! I wish you all the best for 2015!

    Greetings,
    Sebastian

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.