Re: Form Thank You Page - External URL In New Window?

Anonymous
Not applicable

Form Thank You Page - External URL In New Window?

Good Afternoon,

In the Forms 2.0 you can follow up a form submission with a thank you page. If i set my follow up to an external URL is there anyway for that page to open up in a new tab instead of the same tab with the form. If coding on an email or website I use the 

<a href="www.google.com/" target="_blank">

I am asking because we have a marketo form embedded in a lightbox on our website and when we click submit it takes us to an external URL but within the same tab, it would be better if it came up in a new tab.

Thanks,
Evan


I am asking because I have a marketo form 

Tags (1)
17 REPLIES 17
Anonymous
Not applicable

Re: Form Thank You Page - External URL In New Window?

you can use the API for this:  

form.onSuccess(function(followUpUrl){
window.open('yourThankyoupage','_blank' );
});
Anonymous
Not applicable

Re: Form Thank You Page - External URL In New Window?

Thank you for the reply. We are still having some trouble implementing this onto our site. This is the code we are using.
 

MktoForms2.loadForm("//app-abc.marketo.com", "195-NER-971", 2497, function (form){MktoForms2.lightbox(form).show();
});


How do we get the "result page" to open in a new window?

Anonymous
Not applicable

Re: Form Thank You Page - External URL In New Window?

MktoForms2.loadForm("//app-abc.marketo.com", "195-NER-971", 2497, function (form {
   MktoForms2.lightbox(form).show();

   form.onSuccess(function(followUpUrl){
window.open('yourThankyoupage','_blank' );
   });
});
Kim_Gandy1
Level 7

Re: Form Thank You Page - External URL In New Window?

Is this code in addition to the embed code for the light box form?

Anonymous
Not applicable

Re: Form Thank You Page - External URL In New Window?

Hi Kim, I'm not a developer but the embed code is actually already included in that code (see below). The top two lines are calling the form to load up in a lightbox based on marketos API and the bolded below is the unique identifier for our specific company forms. So when you're in design studio and you right click on a form 2.0 and click embed code and go to the lightbox drop down you will see those two lines but with your form ids instead.

Then below that is, the code calls for once the form has successfully been filled out then it will open a thank you page, which in our case we set as our product brochure PDF.

MktoForms2.loadForm("//app-abc.marketo.com", "195-NER-971", 2497, function (form {
   MktoForms2.lightbox(form).show();

   form.onSuccess(function(followUpUrl){

window.open('yourThankyoupage','_blank' );

   });
});

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Thank You Page - External URL In New Window?

It doesn't actually work, though, because any sensible browser will block that as a popup, killing the UX. I have explained the technical reasons why in other posts, if you search for them, and the way around it.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Thank You Page - External URL In New Window?

pastedImage_0.png

Kim_Gandy1
Level 7

Re: Form Thank You Page - External URL In New Window?

Hi Sanford, can you link me to any work around you have?

SanfordWhiteman
Level 10 - Community Moderator

Re: Form Thank You Page - External URL In New Window?