查看页面:
<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();
}
2条答案
按热度按时间szqfcxe21#
请用这个--
查看页面-
型号--
控制器--
qaxu7uf22#
只需从您的响应中获取id。
像这样试试
或者