не наю - может так ?
var copyFormAnswer = undefined;
function setClick (){
jQuery('.answer').one('click', function(){
var formAnswer = jQuery('.aform');
var attrParentId = jQuery(this).attr('id');
copyFormAnswer = formAnswer.clone(true);
formAnswer.find('#id_parent_id').val(attrParentId);
formAnswer.find('#id_message').val('');
jQuery(this).after(copyFormAnswer);
counter = 0;
});
}setClick ();
jQuery('.aform').submit(function() {
var sendData = $(this).serialize();
jQuery.ajax({
data: sendData,
type: $(this).attr('method'),
url: $(this).attr('action'),
success: function(response){
if (copyFormAnswer==undefined){
copyFormAnswer = jQuery('.aform');
}
alert(response["data"]["html"]);
copyFormAnswer.before(response["data"]["html"]);
copyFormAnswer.hide();
setClick ()
copyFormAnswer = undefined;
}
});
return false;
});
});