单个表单上的多个 jQuery AutoSuggest 插件示例
您好,我正在使用这个 Jquery 插件 http://code.drewwilson.com/entry/autosuggest- jquery 插件 我已经在我的表单中成功开发了这段代码。但我在我的表单(页面)中需要这个插件三次。我是这个插件的新手。请帮助我如何放置多个自动建议并以一种形式检索其值。
这是我的自动建议代码。 //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代码 输入类型=“文本”名称=“测试”值=“”类=“hihi”id=“TO”/> 输入类型=“文本”名称=“test1”值=“”类=“hihi”id=“CC”/>
提前致谢。
HI I am using this Jquery Plugin http://code.drewwilson.com/entry/autosuggest-jquery-plugin
I have successfully develop this code in my form . but i need this plugin three times in my form(page). I am new in this plugin. Please help me how can i put more than one Autosuggest and retrive its value in a one form..
This is my code for autosuggest..
//javascrpit code
$("#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 code
input type="text" name="test" value="" class="hihi" id="TO"/>
input type="text" name="test1" value="" class="hihi" id="CC"/>
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题已结束,所以这就是答案...请参阅 jquery 自动完成插件的演示$文档 这里
这是与您的问题相关的示例
availableTags ,availableTags2 和 availableTags3 作为自动完成的来源,您可以根据您的要求更改它
your question got closed so here is the answer ... see the demo $ documentatio of the jquery autocomplete plugin here
here is the example related to your question
availableTags,availableTags2 and availableTags3 act as the source for the auto complete you can change it as per your requirement