我使用自动从该网站提示的jQuery插件:多标签建议的jQuery插件
http://code.drewwilson.com/entry/autosuggest-jquery-plugin
制作标签多个像在该网站给出。
但我的问题是... 从autosuggest中选择时,它显示在我的输入框中,但我不想再次显示选定的autosuggest,就像链接中给出的示例一样....但我我不能做这种事情......
请帮我......被我用来 代码如下:
<link rel="stylesheet" type="text/css" href="view/stylesheet/autoSuggest.css">
<script type="text/javascript" src="view/javascript/jquery/jquery.autoSuggest.js"></script>
<script type="text/javascript"><!--
$("#product_tag1").autoSuggest("http://test.com/ajax", {minChars: 2, matchCase: true,selectedItemProp: "tag", searchObjProps: "tag"});
//--></script>
阿贾克斯文件中像
<?
$input = $_GET["q"];
$data = array();
$query = mysql_query("SELECT * FROM my_table WHERE my_field LIKE '%$input%'");
while ($row = mysql_fetch_assoc($query)) {
$json = array();
$json['tag_id'] = $row['id'];
$json['tag'] = $row['tag'];
$data[] = $json;
}
header("Content-type: application/json");
echo json_encode($data);
?>
我得到了解决方案,它工作正常... – 2012-07-26 06:00:16