Cytat(Comandeer @ 20.05.2015, 21:29:56 )

No to skoro $(this) to niby formularz (co jakoś średnio z tego kodu wynika… pokazałbyś całość, a nie bawisz się tak w kotka i myszkę), to $(this).parent('.educationTab') zakłada, że zachodzi zależność .educationTab > form. Tymczasem w kodzie jest wręcz odwrotnie - form > .educationTab
$(document).ready(function(){
$('#UpdateEducation).submit(function(){
var form = $(this),
formData = form.serialize(),
formUrl = form.attr('action'),
formMethod = form.attr('method'),
responseMsg = $('#info_upd_data');
responseMsg.hide()
.addClass('response-waiting')
.text('proszę czekać...')
.fadeIn(200);
$.ajax({
type: "POST",
url: "/ajax.php",
data: formData,
processData: false,
success: function(data){
var responseData = jQuery.parseJSON(data),
klass = '';
switch(responseData.status){
case 'error':
klass = 'response-error';
break;
case 'success':
klass = 'response-success';
if(form.attr('id') === 'UpdateEducation'){
var nazwa_szkoly = $('input[name="nazwa_szkoly"]').val();
//tu działamy
var that = $(this);
that.hide(10, function () {
that.prev().show();
});
that.parent().prev('.educationTab').append('
<div>Nazwa szkoły:' + nazwa_szkoly + '
</div>');
//tu kończymy działanie
}
break;
}
responseMsg.fadeOut(200,function(){
$(this).removeClass('response-waiting')
.addClass(klass)
.text(responseData.message)
.fadeIn(200,function(){
setTimeout(function(){
responseMsg.fadeOut(200,function(){
$(this).removeClass(klass);
});
},3000);
});
});
console.log(data)//
}
});
return false;
});
});
<form id="UpdateEducation" action="/profil.html" method="POST"> <input type="hidden" name="id_user" value="<?=$row['id_user'];?>">
<div class="educationTab"> <?php
$sqlEducation = "SELECT * FROM `education` WHERE `id_user` = '$id_user' ORDER BY `school_to` DESC LIMIT 10";
$resultEducation = mysql_query($sqlEducation);
while( $row = mysql_fetch_array( $resultEducation ) ){
$row['title'] = htmlspecialchars($row['title']);
$list[ ] = $row;
?>
<div class="education_table"> <div style="padding:15px;" class="cos"> <div style="float:left; width:500px;"><?=$row['name_school'];?></div> <div style="float:left; width:90px;">1999 - 2001
</div> <div style="float:left; width:30px; opacity:0.5;"><img src="/images/profile/ico_trash.png" alt="Usuń" onclick="$(this).delete_school(<?=$row['id'];?>); return false;">
</div> <?php
}
?>
<input type="text" name="nazwa_szkoly" value="">