How to show an Unbounce pop-up based on a cookie not being present

I’m building a landing page at the moment that I want to show a pop-up that contains a form for visitors to register.

Ideally the form will display every time a visitor hits the page, but only until they complete the form successfully.

Reading some of the community posts here, it seems that setting a cookie on the form confirmation page is the way to go. But from what I’ve read there seems to be a challenge getting the landing page to acknowledge the cookie if that cookie is set from a pop-up.

I’d really appreciate someone’s help to:

  1. understand if this is even doable
  2. create the cookie itself
  3. reference that cookie in the advanced targeting section of the pop-up

As far as I can tell, the javascript code I need to create the cookie is:

document.cookie = “form_complete=true”;

But the advanced targeting is looking for the logic “when cookie name is” but I have no idea how to set the cookie name itself.

Am I barking up the wrong tree here?

Thanks for reading this far. Any help is hugely appreciated.

Mark