I, too am having exactly the same problem, except I am using the Mailchimp for WP form plugin.
The url I am having trouble with is:
Angelwalk
Please click on either of the “Download your free mp3” buttons.
Both of you have to add code to your site to accomplish what you’re after. We recommend checking out Getting Started with Custom JavaScript, if you’re not familiar with this process. Also, the basis for the following code can be found here.
@deepthi-yamaka
jQuery(document).on('submit','.popmake-content form', function() {
var $popup = PUM.getPopup(this);
setTimeout(function () {
$popup.popmake('close');
}, 5000); // 5 seconds
});
After the user submits the form, this code will run and automatically close the popup after 5 seconds. The time is measure in milliseconds, and you can change it to a higher value so as to make sure the users see your thank you message.
@saxondesign
Your code is basically the same, but includes MailChimp classes:
jQuery(document).on('subscribe.mc4wp','.popmake-content .mc4wp-form', function() {
var $popup = PUM.getPopup(this);
setTimeout(function () {
$popup.popmake('close');
}, 5000); // 5 seconds
});
Hope this helps!
-
This reply was modified 7 years, 6 months ago by waltmesser.
@waltmesser, thanks so much for such a quick response. Unfortunately, it’s not working for me.
I did as you said and went to the Getting Started with Custom Javascript page, added the action to my functions.php file and put the code in where it says to… it’s still not working. I even set the popup to close at 15000 (15 seconds) so I could see if anything was happening. Nothing has changed; however, the javascript seems to be loading in the footer. The form is still closing after 3 seconds, and no thank you message is appearing.
I’m open to suggestions!
@waltmesser,
thnks for ur reply
as per ur suggestion,
i added the following code to my functions.php file,
but it is throwing an error of “Parse error: syntax error, unexpected ‘<‘ in /home/…./functions.php on line 1866 “.
i am very new to this coding part.please help me how to add this.
any suggestions will be very helpful.
<?php
add_action( ‘wp_footer’, ‘my_custom_popup_scripts’, 500 );
function my_custom_popup_scripts() { ?>
<script type=”text/javascript”>
(function ($, document, undefined) {
// Your custom code goes here.
jQuery(document).on(‘submit’,’.popmake-content form’, function() {
var $popup = PUM.getPopup(this);
setTimeout(function () {
$popup.popmake(‘close’);
}, 10000); // 10 seconds
});
}(jQuery, document))
</script><?php
}
@deepthi-yamaka @saxondesign
I will have our Lead Dev @danieliser take a look as soon as he is available.
Thanks for your patience.
@waltmesser, I am wondering if AJAX needs to be activated in order to keep the page from refreshing. I know that I can activate AJAX using Gravity Forms, but it is not so easy using MailChimp. Could it be that by embedding a gravity form I might have better luck?
Thanks again for your help!
@deepthi-yamaka – Apologies for the delay, the error you got was because you didn’t need the first line.
Simply remove this line:
<?php
@saxondesign – Using a Gravity Form in our popups will automatically turn on AJAX.
Hope that helps.
Closing this ticket due to inactivity. If you’re still having an issue, create a new thread, link this one, and we will continue troubleshooting.
Please take a moment to rate and review the plugin and or support.