Hi neltous ,
Great question. 🤔
The code that you sent in the original post will only look for the cookie when you load in the page. This means that once you fill in your form, Buttonizer will not hide until the user refreshes the page.
To detect if the cookie has been set, you will need to use an interval that will keep looking for the cookie every couple of seconds.
I've managed to hide Buttonizer after filling in a form without relying on cookies by using the trigger that Popup Maker uses.
Copy and paste the script below into your site.
( This only works on Popup Maker forms. When using other forms like Gravity Forms, take a look at Popup Maker's documentation regarding those )
<script type="text/javascript">
jQuery(document).ready(function() {
// #pum-{POPUP-ID}
jQuery('#pum-9663')
// pumFormSuccess is triggered after form success
.on('pumFormSuccess', function () {
// hide Buttonizer
jQuery(".buttonizer").hide()
});
});
</script>
Please let me know if this works for you! 🙂