0
我怎样才能使用单个jQuery自动完成多表单下拉?多个表单下拉单jquery自动完成
这里是我的看法页(头):
$("#full_name").autocomplete({
source: "<?php echo site_url('autocomplete/get_names');?>"
});
$("#department").autocomplete({
source: "<?php echo site_url('autocomplete/get_dept');?>"
});
*** and other like these for subjects, zip and country.
控制器页:
public function get_names(){
$this->load->model('autocomplete_model');
if (isset($_GET['term'])){
$q = strtolower($_GET['term']);
$this->autocomplete_model->get_fullnames($q);
}
}
*** and other functions...
模式页:
function get_fullnames($q)
{
$match = $q;
$this->db->select('full_name');
$this->db->like('full_name', $match,'after');
$query = $this->db->get('employee_list');
if($query->num_rows > 0){
foreach ($query->result_array() as $row){
$row_set[] = htmlentities(stripslashes($row['full_name']));
}
echo json_encode($row_set);
}
}
我如何可以实现一个单一的搜索项,可以用于多个标准?
谢谢你们提前..
感谢您的信息.. – swordfish 2013-02-10 19:48:45