Answered

only showing survey when not filled out

  • 21 March 2022
  • 4 replies
  • 86 views

Hi all, 

 

I want to add a survey to a website of an animation film festival. But I only want to show the questions to people who have not filled out the survey yet. And I would also like the option to have them say no and not showing the survey again. How can we make this happen? 

 

Thanks for your feedback, 

Kim

icon

Best answer by mathio 21 March 2022, 16:37

View original

4 replies

Userlevel 7
Badge +5

Hi @Ask your Audience Ah fun! What is the animation film festival you’re working for? (If you don’t mind sharing!)

You would need to write your own code that can track who has filled out the form and to show it to those who haven’t, as this isn’t something included in our embed code. 

@mathio or @picsoung might have some examples of this code for you. 

Userlevel 7
Badge +5

The simplest approach would be to set a cookie on typeform completion and only show the embed if the cookie is not set. 

Something like this:

<div
id="my-typeform"
data-tf-widget="oWPUHPmF"
data-tf-on-submit="myTypeformDidSubmit"
style="width:100%;height:400px;"
></div>
<script src="//embed.typeform.com/next/embed.js"></script>
<script>
function myTypeformDidSubmit() {
document.cookie="myTypeformDidSubmit=1"
}

if (document.cookie.includes("myTypeformDidSubmit=1")) {
document.querySelector('#my-typeform').remove()
}
</script>

 

Thanks! I’ve send the information to the developer.

Hopefully he’ll be able to work something out. 

 

Userlevel 7
Badge +5

Let us know how it goes, @Ask your Audience !

Reply