Title: Auto close after MC4WP submit
Last modified: May 23, 2022

---

# Auto close after MC4WP submit

 *  Resolved [pastichedesign](https://wordpress.org/support/users/pastichedesign/)
 * (@pastichedesign)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/auto-close-after-mc4wp-submit/)
 * Hi,
 * I am using Boxzilla with a MC4WP form shortcode. All is working OK but is it 
   possible to auto close the box and overlay after the submit in the form is clicked
   rather than the user having to click the close button.
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/auto-close-after-mc4wp-submit/#post-15669662)
 * It’s not officially possible, but you can do it with some custom Javascript code.
 * First you would need to make sure the MC4WP form submitted without errors, by
   listening to the subscribed event:
 * [https://www.mc4wp.com/kb/javascript-form-events/](https://www.mc4wp.com/kb/javascript-form-events/)
 * and then you have to close the Boxzilla box:
    [https://kb.boxzillaplugin.com/showing-boxes-manually/](https://kb.boxzillaplugin.com/showing-boxes-manually/)
 *     ```
       <script type="text/javascript">
       mc4wp.forms.on('subscribed', function(form, data, updated) {
       Boxzilla.dismiss(5);
       })
       </script>
       ```
   
 * The example above assumes the Boxzilla box ID nr 5.
 * Hope that helps. If you have any questions, please let me know!

Viewing 1 replies (of 1 total)

The topic ‘Auto close after MC4WP submit’ is closed to new replies.

 * ![](https://ps.w.org/boxzilla/assets/icon-256x256.png?rev=1414640)
 * [Boxzilla - WordPress Popup Builder](https://wordpress.org/plugins/boxzilla/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/boxzilla/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/boxzilla/)
 * [Active Topics](https://wordpress.org/support/plugin/boxzilla/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/boxzilla/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/boxzilla/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/auto-close-after-mc4wp-submit/#post-15669662)
 * Status: resolved