[{
"wuliuid": "2",
"shouhuoren": "2",
"mudidi": "2",
"jiesuanfangshi": "2",
"zhongzhuan": "2",
"shouhuorendizhi": "2",
"shouhuorendianhua1": "2",
"shouhuorendianhua2": "2",
"shouhuorendianhua3": null,
"shouhuorendianhua4": null
}]
这是从后台获取的数据
function checkshouhuoren() {
//1获取用户名
var shouhuoren = $("#shouhuoren").val();
//查找信息
$.post("find/findByShr",$("#shouhuoren").serialize(),function (data) {
//
console.log(data)
//自动填充表格数据
//[{"wuliuid":"1","shouhuoren":"1","mudidi":"1","jiesuanfangshi":"1","zhongzhuan":"1","shouhuorendizhi":"1","shouhuorendianhua1":"1","shouhuorendianhua2":"1","shouhuorendianhua3":null,"shouhuorendianhua4":null}]
//目的地
$("#mudidi").val(data.mudidi);
//中转
$("#zhongzhuan").val(data.zhongzhuan);
//详细地址
$("#shouhuorendizhi").val(data.shouhuorendizhi);
//电话1
$("#shouhuorendianhua1").val(data.shouhuorendianhua1);
//\电话2
$("input[name=shouhuorendianhua2]").val(data.shouhuorendianhua2);
//电话3
$("input[name=shouhuorendianhua3]").val(data.shouhuorendianhua3);
//电话4
$("input[name=shouhuorendianhua4]").val(data.shouhuorendianhua4);
//
});
}
<tr>
<td >
<p>收货人信息</p>
</td>
<td class="td_left">
<label for="mudidi" >目的地</label>
</td>
<td class="td_right">
<input type="text" id="mudidi" name="mudidi" />
</td>
<td class="td_left">
<label for="zhongzhuan">中转</label>
</td>
<td class="td_right">
<input type="text" id="zhongzhuan" name="zhongzhuan" />
</td>
<td class="td_left">
<label for="shouhuorendizhi">详细地址</label>
</td>
<td class="td_right">
<input type="text" id="shouhuorendizhi" name="shouhuorendizhi"/>
</td>
<td class="td_left">
<label for="shouhuorendianhua1">电话1</label>
</td>
<td class="td_right">
<input type="text" id="shouhuorendianhua1" name="shouhuorendianhua1" >
</td>
<td class="td_left">
<label for="shouhuorendianhua2">电话2</label>
</td>
<td class="td_right">
<input type="text" id="shouhuorendianhua2" name="shouhuorendianhua2" >
</td>
<td class="td_left">
<label for="shouhuorendianhua3">电话3</label>
</td>
<td class="td_right">
<input type="text" id="shouhuorendianhua3" name="shouhuorendianhua3">
</td>
<td class="td_left">
<label for="shouhuorendianhua4">电话4</label>
</td>
<td class="td_right">
<input type="text" id="shouhuorendianhua4" name="shouhuorendianhua4" >
</td>
</tr>