Close a fancybox when you submit a form


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* Close the fancybox when you submit a form
  2.  */
  3. $('#myform').submit(function(){
  4. $.fancybox.close();
  5. return false;
  6. });
  7.  
  8. /* Here's another approach,
  9.  * but this time we're tied to the submit button
  10.  */
  11.  
  12. $('#submit_button').click(function(){
  13. $.fancybox.close();
  14. return false;
  15. });

URL: http://www.dropthenerd.com/close-fancybox-when-you-submit-a-form-revisited

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.