Forked from RafaelFunchal/MailPoet: Redirect After Submit
Created
February 19, 2016 09:35
-
-
Save freezvd/8b7ec679d341140d291d to your computer and use it in GitHub Desktop.
Redirects to a custom link after submits the subscription form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function($){ | |
$(document).ready(function(){ | |
$( 'form.widget_wysija' ).submit(function(e){ | |
e.preventDefault(); | |
setTimeout(function() { | |
var msg = $( '.wysija-msg' ); | |
if( msg.text() !== '' ){ | |
window.location.replace( 'http://your_thank_you_page_url' ); | |
} | |
}, 3000); | |
}); | |
}); | |
})(window.jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, can you help me?
I'm using two forms to subscribe to the same newslleter list. But each one redirects for a differents pages after submission.
Is it possible in this code specify the two forms? Using the if or something like that?
Thank you!