我在Codeigniter中遇到问题,它在下拉菜单中调用data(mysql)
然后填入文本框
<tr>
<td>Item No:</td>
<td><select type="text" id="inventoryitemno" name="inventoryitemno" value="getitemno" onChange="getitemnoetc(inventoryitemno);" >
<?php
foreach($itemno as $row){
echo "<option id=".$row->prod_id.">".$row->prod_itemno."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Description:</td>
<td><input type="text" id="idesc" name="idesc"/></td> <!-- disabled="disable" -->
</tr>
<tr>
<td>UOM:</td>
<td><input type="text" id="inventoryuom" name="inventoryuom" /></td><!-- disabled="disable" -->
</tr>
<tr>
这是JavaScript;试图调用数据
<script type="text/javascript">
function getitemno(str)
{
???????
}
</script>
这是我的 CI_model
public function getitemnoetc($inventoryitemno){
$inventoryitemno=$_GET["inventoryitemno"];
$this->load->database();
$data = $this->db->query('select prod_id, prod_desc, prod_selluom from product where prod_itemno ='.$inventoryitemno.';');
return $data->result();
}/*end of function*/
我希望你能得到我的问题。