Pop-up Follow-up instead of redirect to a landing page

Pop-up Follow-up instead of redirect to a landing page

I want to be able to have a pop-up message appear after someone subscribes to my newsletter.

Signing up to a newsletter doesn't warrant a redirect to a landing page to say "thanks for subscribing" a simple message displayed where the user entered their email address is all I want. [Without having to customise and build workarounds] 
6 Comments
Kenny_Elkington
Marketo Employee
Hi Julia,

This is a great idea for a feature enhancement.  For now you can do this via the forms 2 API, however.  This example code will replace your form with HTML content of you choosing when it submits successfully:

<script>
MktoForms2.whenReady( function(form) {
	form.onSuccess ( function (values, followUpUrl){
		return false;
		$(".mktoForm").replaceWith('<div><p>Enter Whatever HTML Content you want here</p></div>');//you can also submit a DOM object in the replaceWith method
		});
	});
</script>


Anonymous
Not applicable
Thanks Kenny!
So where do I put this javascript exactly? 
This form is going to be embedded on a non-marketo page, can you give me a step by step guide please of how this would work exactly.

Thank you!
Kenny_Elkington
Marketo Employee
Hi Julia,

This script needs to be placed somewhere after the form embed code.  As far as adding it to your page, that's dependent on what CMS or hosting that you use.  I'd suggest searching for  something along the line of 'how to add a script to a page in [my CMS software]' for instructions on how to do that.
Anonymous
Not applicable

Thank you! 

Anonymous
Not applicable

Oh awesome, thanks!! I'll give it a go

kh-lschutte
Community Manager
Status changed to: Already have it