【发布时间】:2018-11-06 06:44:55
【问题描述】:
查看页面:
<label >Challan No.</label>
<input type="text" class="form-control" id="dispach_challan_no" name="dispach_challan_no" placeholder="Enter Challan No">
<script>
$.ajax({
url :"<?php echo base_url();>booking/dispatch_challan/DispatchChallanController/fetchId",
type:"GET",
dataType: "html",
success: function(data){
$('#dispach_challan_no').html(data);
},
error:function(data){
alert("error message"+data);
},async:false,
});
</script>
模型页面:
public function fetchId(){
$query= $this->db->select('*')->from('bilty')->get();
return $query->result_array();
}
控制器
public function fetchId()
{
$modelResult = $this->dispatchModel->fetchId();
}
【问题讨论】:
-
你有什么错误吗?
-
不知道你到底卡在哪里了?
-
$('#dispach_challan_no').val(data);