$(document).on('click','#manifest_id',function(e){
var id = $(this).html();
var behaviour = "incoming";
$("#print_manifest").removeAttr('disabled');
$.ajax({
type : "POST",
url : "get_manifest_record.php",
data : {'manifest_id' : id , 'function' : behaviour},
success : function(data)
{
$('#results').html(data);
$("#print_id").attr("value",id);
$("#print_function").attr("value",behaviour);
},
dataType : "html"
});
$.post("populate_field_man.php", { id : id , behaviour : behaviour },
function(result){
$("#form_field2").val(result.dispatched_date);
$("#form_field3").val(result.received_date);
$(".p_bag").val(result.p_bag);
$(".hub_city").val(result.hub_city);
$(".to_city").val(result.to_city);
$(".time").val(result.time);
},"json");
});