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

发布于 2024-10-18 17:43:20 字数 775 浏览 6 评论 0原文

您好,我正在使用这个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执笔绘流年 2024-10-25 17:43:20

您的问题已结束,所以这就是答案...请参阅 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文