Automatic modal closure after button pressed on it

Hi @twmeric,

Here the code you need to insert in the page that will be used as a popup and where the form is (so not to be inserted in the parent page)

<script>
document.addEventListener('DOMContentLoaded', () => {
  window.addEventListener('submit-form-success-form1', () => {
    window.parent.location.reload();
  });
});
</script>

Just change form1 by the name of your form

@flavi Just to be sure, you want the page to refresh after clicking on this X button (the close button) or after a form submission? If after a form submission: just do exactly like I wrote above.
If it’s on close modal action (so with the X button), I dont have any solution and I won’t do it (I realize there is no sense to have such action)

1 Like