Title: Help &#8211; Javascript Dialog Closure Callback
Last modified: August 21, 2016

---

# Help – Javascript Dialog Closure Callback

 *  [codemagnet](https://wordpress.org/support/users/codemagnet/)
 * (@codemagnet)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/help-javascript-dialog-closure-callback/)
 * Hi.
 * i have installed the plugin and it is working fine. I’m using it to show a mailchimp
   form and I want to hide the close button and have the overlay only close when
   the visitor clicks the “Subscribe” button (#mc-embedded-subscribe) on the mailchimp
   form.
 * I’m certain the setting “Javascript Dialog Closure Callback” is where I need 
   to be. I have some very basic Javascript skills but I am struggling to get this
   working.
 * ive currently got this in the footer:
 *     ```
       <script>
       ( function( $ ) {
       	$( "#mc-embedded-subscribe" ).click(function() {
       		parent.jQuery.fancybox.close();
       	});
       })( jQuery );
       </script>
       ```
   
 * This is not throwing any errors up but it isn’t achieving the desired effect.
   Can someone help me out here.
 * Thanks
 * [http://wordpress.org/plugins/modal-dialog/](http://wordpress.org/plugins/modal-dialog/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Yannick Lefebvre](https://wordpress.org/support/users/jackdewey/)
 * (@jackdewey)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/help-javascript-dialog-closure-callback/#post-4187237)
 * Have you checked with tools like Firebug if the callback function is actually
   being executed?
 *  [galzalex](https://wordpress.org/support/users/galzalex/)
 * (@galzalex)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/help-javascript-dialog-closure-callback/#post-4187441)
 * codemagnet’s code works for me. I added the code below the mailchimp code but
   the problem is, it still closes even if you won’t fill the form.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help – Javascript Dialog Closure Callback’ is closed to new replies.

 * ![](https://ps.w.org/modal-dialog/assets/icon-256x256.jpg?rev=971132)
 * [Modal Dialog](https://wordpress.org/plugins/modal-dialog/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/modal-dialog/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/modal-dialog/)
 * [Active Topics](https://wordpress.org/support/plugin/modal-dialog/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/modal-dialog/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/modal-dialog/reviews/)

## Tags

 * [popup](https://wordpress.org/support/topic-tag/popup/)

 * 2 replies
 * 3 participants
 * Last reply from: [galzalex](https://wordpress.org/support/users/galzalex/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/help-javascript-dialog-closure-callback/#post-4187441)
 * Status: not resolved