put the fancybox in the first window - it opens without problems, but the second one redirects to the ajax / send_form_callback.php link, here's the code with js:

$(".block-header .callback-btn-js, .block-footer .footer-callback-js").click(function() { $.fancybox.open({ type: 'ajax', ajax: { type: "POST", data: {}, }, href: '../ajax/get_form_callback.php', transitionIn: 'elastic', transitionOut: 'elastic', speedIn: 600, speedOut: 200, overlayShow: false, width: 882, padding: 0, closeBtn: false, beforeShow: function() { $(".popup-callback-close").click( function(e) { $.fancybox.close(); }); $('.form-active').ajaxForm({ dataType: 'json', success: function(data) { $('.form-active .error-show').removeClass('error-show'); if (data.ERRORS) { if (data.ERRORS.NAME) { $('.form-active [name="NAME"]').parent().addClass('error-show'); $('.form-active [name="NAME"]').parent().find('.block-error').html(data.ERRORS.NAME); } if (data.ERRORS.PHONE) { $('.form-active [name="PHONE"]').parent().addClass('error-show'); $('.form-active [name="PHONE"]').parent().find('.block-error').html(data.ERRORS.PHONE); } } else { $.fancybox.close(); $.fancybox.open({ type: 'ajax', ajax: { type: "POST", data: {}, }, href: '../ajax/send_form_callback.php', transitionIn: 'elastic', transitionOut: 'elastic', speedIn: 600, speedOut: 200, overlayShow: false, padding: 0, closeBtn: false, beforeShow: function() { $(".popup-success-close").click( function(e) { $.fancybox.close(); }); } }); } } }); } }); return false; }); 

    0