function editEmploymentDetails(id){
$.ajax({
type:"POST",
url:'getEmploymentDetailsForEdit.php',
dataType:"json",
data:{id:id},
success:function(response){
console.log(response);
$("#expDesignation").val(response[0]['designation']);
$("#txtOrganization").val(response["organization"]);
$("#startDate").val(response["starts_date"]);
$("#endDate").val(response["ends_date"]);
$("#txtJobProfile").val(response["job_profile"]);
$("#btnEmployment").val("Update");
}
});
}
Forget to write dataType:"json"