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!
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.
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
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.
this works fine for me from an iFrame, but we open a new tab I believe.
form.onSuccess(function() {
window.open(LinkURL);
return false;
});
window.open will be blocked as a popup unless you create the window in onSubmit.
Really? Hasn't for me yet.
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).
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;
})
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.