When the user press entre the data will be save into database.
Ajax
$('td.edit').keydown(function(event){
arr = $(this).attr('class').split( " " );
var clientid=document.getElementById("client").value;
account_id=document.getElementById("account_id").value;
if(event.which == 13)
{
$.ajax({ type: "POST",
url:"clientnetworkpricelist/update.php",
data: "value="+$('.ajax input').val()+"&rowid="+arr[2]+"&field="+arr[1]+"&clientid="+clientid+"&account_id="+account_id,
success: function(data){
$('#CPH_GridView1_Status').append(data);
$('.ajax').html($('.ajax input').val());
$('.ajax').removeClass('ajax');
}});
}
}
Html
<td id="CPH_GridView1_Status'.$rows['net_id'].'" class="edit2 status '.$rows["net_id"].' "><img src="image/'.$rows["status"].'f.png" /></td>
After success I want to retrieve data from database and place it in the proper td ( in the same row of the clicked td) i am success to retrieve data but not retrieve in the correct td
context:option to$.ajax()to send context to thesuccessfunction that identifies the row.$(this)pointer should be still pointing to the clicked td, so why dont you use that to set the data back on to the event generated td