svikator, пробуйте
$(function() {
$('body').on('click', '#button-send-review', function(e){
var parent = $(this).parents('#send-review');
var name = $("#name_review",parent).val();
var good = $("#good_review",parent).val();
var bad = $("#bad_review",parent).val();
var comment = $("#comment_review",parent).val();
var iid = $("#button-send-review",parent).attr("iid");
if (name != "")
{
name_review = '1';
$("#name_review",parent).css("borderColor","#DBDBDB");
}else {
name_review = '0';
$("#name_review",parent).css("borderColor","#FDB6B6");
}
if (good != "")
{
good_review = '1';
$("#good_review",parent).css("borderColor","#DBDBDB");
}else {
good_review = '0';
$("#good_review",parent).css("borderColor","#FDB6B6");
}
if (bad != "")
{
bad_review = '1';
$("#bad_review",parent).css("borderColor","#DBDBDB");
}else {
bad_review = '0';
$("#bad_review",parent).css("borderColor","#FDB6B6");
}
// Глобальная проверка и отправка отзыва
if ( name_review == '1' && good_review == '1' && bad_review == '1')
{
$("#button-send-review",parent).hide();
$(".auth-loading").show();
$.ajax({
type: "POST",
url: "/include/add_review.php",
data: "id="+iid+"&name="+name+"&good="+good+"&bad="+bad+"&comment="+comment,
dataType: "html",
cache: false,
success: function() {
setTimeout("$.fancybox.close()", 1000);
}
});
}
});
});