Survey in a lightbox - second survey opens full -screen | Community
Skip to main content
Answered

Survey in a lightbox - second survey opens full -screen


Hi. I have a Typeform survey in my app which opens in a lightbox, however if I link this to another survey, rather than open in the same lightbox, the second survey opens full-screen - the only way for the user to get back to my app is via the back button. Is there a solution for this?

 

Best answer by mathio-tf

Hello @dngood and @Liz , happy Friday!

You can specify redirect target in your typeform embed. More details in the embed lib docs (look for redirectTarget) or in my blog article from last year. You need to use the value _self.

@dngood it looks like you are embedding your typeform directly in an iframe. If you want to use this feature, you need to use our embed SDK.

 

BTW did you know that our embed SDK supports embedding the typeform in a popup? No need to use a lightbox or your custom popup. More details here: https://www.typeform.com/help/a/embed-your-typeform-360029249212/#h_01FKFTT9N3YHW4C6VEWT7R9C48

However you are more than welcome to use your own if you like it better 😃

View original

9 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15035 replies
  • April 20, 2023

Hi @dngood Could you share the URL where you have the form embedded? Thanks in advance!


  • Author
  • Explorer
  • 4 replies
  • April 20, 2023

Sorry, it's in an app that's not publicly available.


  • Author
  • Explorer
  • 4 replies
  • April 21, 2023

@Liz , For testing purposed, I have moved this to somewhere it can be accessed: https://help.animana.com/feedback-test/ (pw: thisisatest)


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15035 replies
  • April 21, 2023

Thanks, @dngood ! I believe this would require custom code to have it open in the same lightbox, but @mathio do you know for sure? 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • April 21, 2023

Hello @dngood and @Liz , happy Friday!

You can specify redirect target in your typeform embed. More details in the embed lib docs (look for redirectTarget) or in my blog article from last year. You need to use the value _self.

@dngood it looks like you are embedding your typeform directly in an iframe. If you want to use this feature, you need to use our embed SDK.

 

BTW did you know that our embed SDK supports embedding the typeform in a popup? No need to use a lightbox or your custom popup. More details here: https://www.typeform.com/help/a/embed-your-typeform-360029249212/#h_01FKFTT9N3YHW4C6VEWT7R9C48

However you are more than welcome to use your own if you like it better 😃


  • Author
  • Explorer
  • 4 replies
  • April 21, 2023

Hi @mathio, and thanks for your reply. 

Unfortunately the production version needs to be in an environment where all I can do is provide a URL, the contents of which will display in an iframe in a lightbox, so no options to use anything more complicated that that. So I think this looks like it’s not possible this time.


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • April 24, 2023

We could have a look under the hood at what does embed SDK do to achieve this functionality.

Here you can see that it actually adds a query param to the URL. So if you add ?typeform-embed-redirect-target=_self to your typeform URL it should work. However no promises for the future, since the official approach is to use the SDK 😃


  • Author
  • Explorer
  • 4 replies
  • April 27, 2023

@mathio , thanks, unfortunately, adding ?typeform-embed-redirect-target=_self to the end of the Typeform redirect URL doesn’t work - the second survey still appears full-screen.

However, I have since found a different (non-Typeform) solution which we will use in this case. Thanks for your help. 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15035 replies
  • April 27, 2023

Glad to hear you were able to find a solution that works for you regardless, @dngood !


Reply