Skip to main content
Answered

Restart a embedded form

  • Apr 9, 2024 10:09 AM UTC
  • 6 replies
  • 233 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

Best answer by mathio-tf

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).

View original

6 replies

Liz
Ex–Typefomer
Forum|alt.badge.img+5
  • Tech Community Advocate
  • Apr 9, 2024 12:25 PM UTC

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. 😀


  • Author
  • Explorer
  • Apr 9, 2024 2:38 PM UTC

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. 


Liz
Ex–Typefomer
Forum|alt.badge.img+5
  • Tech Community Advocate
  • Apr 11, 2024 6:53 PM UTC

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


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • Answer
  • Apr 12, 2024 9:58 AM UTC

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).


  • Author
  • Explorer
  • Apr 15, 2024 10:50 AM UTC

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


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • Apr 15, 2024 10:56 AM UTC

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>