[LIGHTBOX] Force Embed Button to open in parent frame

Hi there!

I’ve got a form embed from my CMS (Hubspot) to my landing page, inside a lightbox.

My problem is that when people complete the form they are sent to the redirection page within the lightbox.
I’d like to know if there is a way for me to open the redirection page in the parent frame by default.

The form submit CTA is embed as well so there I don’t have the ‘Target’ option in the Unbounce menu.

Thanks!

Hi @Tanguy :wave:

I bet the form submit target is set to _blank so you might be able to edit the code to use _parent instead.

Hi Kyle, thanks for your answer!

Sadly the form is embedded from Hubspot so I don’t have (/know) the option to access its code (can just do basic amends from the Hubspot Form Builder…)

Ah yeah, I did some Googling and it seems to customize the forms you would need a certain tier plan and of course a little javascript knowledge.

I don’t use Hubspot personally, sorry I can’t be of more help.

That’s actually useful; I’ve been able to change the embedding code, following the JS example.

This is the bit I added after the default values ;
image

I tried and nothing changed: the post-submission page still opens in the lightbox. Do you see any obvious syntax error in the part I added to the default script?

Thanks again.

1 Like

Oh nice!

Would you be able to share the URL to the page this is on? Or duplicate one to test with?

I could take a look at the code on the page and maybe help out a little bit.

https://inbound.adeogroup.co.uk/hs-form-test/

I created a test page with a similar form for you to test.

Thanks!!

1 Like

It all looks proper to me @Tanguy

I think the reason it isn’t working is because the Hubspot form is acting like an iframe within an iframe. We know the Unbounce Lightbox is indeed an iFrame of the parent page. But then we have added another layer of content inside the Lightbox iFrame.

So the web browser/form is redirecting to the only parent it knows – the Unbounce Lightbox.

I think I’ve seen this sort of “iFrame within an iFrame” conflict come up in the community before. I reckon the easiest solution is to just redirect your form submit to a completely different webpage.

Thanks Kyle!

Any idea how I can redirect the form submit to a different webpage rather than the parent it knows?

I think that would need to take place when you build the form in Hubspot.

Surly there is an option to redirect the user to another page when the form submits.

Yep that is already whatI have, however there is no option to force a different webpage.

image

Oh strange. Well like I said, I’ve never used Hubspot. Maybe another community friend who uses Hubspot will chime in.

Or maybe you could message Hubspot support :man_shrugging:

Ill try this; thanks for all your help anyway, really much appreciated :slight_smile:

1 Like

I just realized my reply was kind of circular. Of course you have been using the redirect option, it redirects inside the Lightbox… :man_facepalming:

So yes, keep up the good work lol! Hopefully someone else could give some advice too.