单个表单上的多个jQuery AutoSuggest插件的示例

时间:2011-02-22 16:08:39

标签: jquery jquery-plugins autocomplete autosuggest

我正在使用这个Jquery插件http://code.drewwilson.com/entry/autosuggest-jquery-plugin 我已经在我的表单中成功开发了这段代码。但我需要这个插件三次在我的表格(页面)。我是这个插件的新手。请帮助我如何将一个以上的Autosuggest放入其中并以一种形式检索其价值。

这是我的autosuggest代码.. // javascrpit代码

$("#CC").autoSuggest("loadcontact.html", {minChars: 2, matchCase: true});
            $("#TO").autoSuggest("loadcontact.html", {minChars: 2, matchCase: true});



            $("#send").click(function(){
                alert($(".as-values").val());//getting currect value

                alert($("#CC").val());//getting undefined...

            });

// JSP代码 input type =“text”name =“test”value =“”class =“hihi”id =“TO”/> input type =“text”name =“test1”value =“”class =“hihi”id =“CC”/>

先谢谢。

1 个答案:

答案 0 :(得分:1)

您的问题已关闭,所以答案就是答案...请参阅jquery自动完成插件的{em> demo $ documentatio here

这是与您的问题相关的example

availableTags,availableTags2和availableTags3作为自动完成的来源,您可以根据自己的要求进行更改