Embeded Marketo form with Follow up with external link not working | Community
Skip to main content
Level 2
February 26, 2020
Question

Embeded Marketo form with Follow up with external link not working

  • February 26, 2020
  • 1 reply
  • 3514 views

Hi,

 

I have a marketo form embeded on a non marketo landing page with the thank you page as External URL. However once the submit form is clicked nothing seems to happen. I tried a code I found on a separate ticket and now an black page opens. Any help with this?

 

 


var formEl = form.getFormElem()[0],
thankYouWindow;

form.onSubmit(function(form) {
thankYouWindow = window.open('');
});

form.onSuccess(function(vals, thankYouURL) {
thankYouWindow.document.location =
thankYouURL;
formEl.innerHTML = 'Thank you! Your NATSPEC branded worksection has opened in a new window.';
return false;
});
});

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
February 26, 2020

Please highlight your code using the Syntax Highlighter so it's readable.

 

And provide your URL - need to see what else is going on on your page.

Level 2
February 26, 2020

This is external page with the form - rondo.com.au/resources/design/natspec-branded-worksections/

 

<script src="//app-sn02.marketo.com/js/forms2/js/forms2.min.js"></script><link itemprop="stylesheet" rel="stylesheet" type="text/css" href="https://go.rondo.com.au/rs/653-INQ-695/images/rondo-mktoForm-styles.css"/><form class="whiteform"  id="mktoForm_1764"></form><script>MktoForms2.loadForm("//app-sn02.marketo.com", "653-INQ-695", 1764); MktoForms2.whenReady(function(form) {

	var formEl = form.getFormElem()[0],
		thankYouWindow;

	form.onSubmit(function(form) {
		thankYouWindow = window.open('');
	});

	form.onSuccess(function(vals, thankYouURL) {
		thankYouWindow.document.location = 
  thankYouURL;
		formEl.innerHTML = 'Thank you! Your NATSPEC branded worksection has opened in a new window.';
		return false;
	});
});  </script>
SanfordWhiteman
Level 10
February 26, 2020

You have 2 different whenReady listeners in the stack. It's not just the one you're showing here. Remove the other one that starts on L#128: