Re: Trouble getting an external URL to display in Thank You Page after a form submit

Kerry_Productio
Level 2

Trouble getting an external URL to display in Thank You Page after a form submit

I'm having trouble getting an external URL to display in Thank You Page after a form submit.  The form is currently iframed in our website.  When you hit submit on the form, right now it's just blank.  I think it's just Staying On The Same Page, which was our initial setting on the form for the Thank You page. 

I've approved the form template and the landing page after making the change, so that's not the issue.

Any ideas?

Thanks in advance!

Tags (1)
17 REPLIES 17
SanfordWhiteman
Level 10 - Community Moderator

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Are you attempting to change the URL of the top-level document, or the URL of the document in the IFRAME? Post the URL to the page, please.

Grégoire_Miche2
Level 10

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Hi Kerry,

Since the form is in an iframe, the thank you page will only replace the content of the iframe. It will not drive the whole page to the other external URL.

How have you set the external URL? In the form ? in the Landing page ?

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Since the form is in an iframe, the thank you page will only replace the content of the iframe. It will not drive the whole page to the other external URL.

If you don't use onSuccess, yes. that's true.  But using the custom event, it's quite possible to replace the top-level document, either if the domains share a parent and/or if you can add a line of JS to the top-level document.

Robb_Barrett
Level 10

Re: Trouble getting an external URL to display in Thank You Page after a form submit

this works fine for me from an iFrame, but we open a new tab I believe.

form.onSuccess(function() {

window.open(LinkURL);

return false;

      });

SanfordWhiteman
Level 10 - Community Moderator

Re: Trouble getting an external URL to display in Thank You Page after a form submit

window.open will be blocked as a popup unless you create the window in ​onSubmit.

Robb_Barrett
Level 10

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Really? Hasn't for me yet.

SanfordWhiteman
Level 10 - Community Moderator

Re: Trouble getting an external URL to display in Thank You Page after a form submit

What's a sample URL?  This is a known limitation when window.open is not in response to a user-initiated event (onSuccess is not in response to user activity, but onSubmit is).

Anonymous
Not applicable

Re: Trouble getting an external URL to display in Thank You Page after a form submit

I am having this exact issue. So if I add this (below) it will work? Do I add it to the site or my LP that is in the iframe?

form.onSubmit(function() {

window.open(LinkURL);

return false;

      })

SanfordWhiteman
Level 10 - Community Moderator

Re: Trouble getting an external URL to display in Thank You Page after a form submit

You should use the code I posted above which touches both pages and can deal with problems in some environments (that is, if your IFRAMEs share the same registered domain but the IFRAME has been embedded in sandboxed mode, it will still work).

The code you posted cannot bust out of an IFRAME, ever.  The page will remain framed.