Answered

Restart a embedded form

  • 9 April 2024
  • 6 replies
  • 41 views

Hello, I’m embedding a Q&A form on a webpage and I would like users to be able to restart the form to submit a new question without reloading the entire page as the page contains a live stream.
Is there a way to do it? 
Thanks

icon

Best answer by mathio 12 April 2024, 11:58

View original

6 replies

Userlevel 7
Badge +5

Hi @fab420 Thanks for stopping by the community! I hope you’re having a great week so far. 

I believe you could just put the url of your form into the redirect url settings, which would then either automatically redirect them back to the form or redirect them when they click the button on the end screen. 😀

Thank you @Liz I’ve tried that but unfortunately entering the URL of the typeform will reload it in full screen instead of its initial embed size. 

Userlevel 7
Badge +5

Ahhh got it, @fab420 . This might have to be a custom solution then. @mathio might possibly have some suggestions for you!

Userlevel 7
Badge +5

You can set redirect target for your form to redirect inside the iframe by adding data-tf-redirect-target=”_self” to your embed code (see embed SDK docs).

An alternative would be to handle this inside an onSubmit callback with custom JavaScript implementation (see docs).

Thank you @mathio,

 

I’m using Framer and I ended up embedding the URL of the form adding the parameter 

?typeform-embed-redirect-target=_self, and it’s working great!

 

However I wasn’t able to make it work by adding data-tf-redirect-target=”_self” to the following embed code:

<div data-tf-live="TYPEFORM ID"></div><script src="//embed.typeform.com/next/embed.js"></script>

I would really appreciate if you could help me to understand how to make it work also with the embed code for future reference. 

Many thanks

Userlevel 7
Badge +5

You can put the attribute into the code like this:

<div data-tf-live="TYPEFORM ID" data-tf-redirect-target="_self"></div><script src="//embed.typeform.com/next/embed.js"></script>

 

Reply