I have a modal popup with a form on the home page of my client site, it opens with some webflow interactions and posts through to mailchimp using logic flow. I would like to hide the popup from future display once someone has joined the list (success message). I’ve tried a few things but nothing seems to work exactly as I’d like. Any help would be appreciated!
Here is my site Read-Only: Webflow - Cookie set Hayworth.co
Here’s a quick guide:
document.cookie = "signedUp=true; max-age=3600; path=/";.
- On the home page, check if the cookie is there:
if(document.cookie.indexOf("signedUp=") != -1).
- If the cookie exists, use Webflow to keep the popup hidden.
This should do the trick.
You can do this with some custom code to suppress it, and use a cookie to track when it’s suppressed for future visits.
I have a similar attributes-based solution here but the suppression is triggered by a click event like closing the modal. What you’re describing here is a bit different with the success message, and more complex.
You might use a mutationobserver to detect the display of the success message?