使用jQuery选择的插件提出标签建议 [英] Making a tag suggestion using jQuery chosen plugin

查看:80
本文介绍了使用jQuery选择的插件提出标签建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery选择的插件 https://github.com/harvesthq/chosen/来使我的选择表单字段漂亮.这是所选插件 https://github.com/harvesthq/chosen

I am using jquery chosen plugin https://github.com/harvesthq/chosen/ to make my select form fields pretty. Here is the demo page for chosen plugin https://github.com/harvesthq/chosen

我在考虑是否可以使用所选插件制作类似stackoverflow的标签,因为它的某些功能看起来很相似.我也想知道如何与Ajax一起使用selected来添加标签建议.

I was thinking if it is possible to make tags like stackoverflow using chosen plugin because some of its feature looks alike. I am also like to know how do i use chosen with ajax to add tag suggestions.

我可以在其中使用这些jquery标签之一,但是我想知道是否可以使用selected来做到这一点,所以我不需要在页面中添加其他脚本.

I could use one of those jquery tags out there but i would like to know if i can do it using chosen so i don't need to add another script with my page.

如果您需要了解更多信息,请告诉我.

Let me know if you need to know anything more.

推荐答案

您要做的就是使用

All that you have to do is to modify the select box with an ajax request. Than use :

$("#form_field").trigger("list:updated");

告诉选择"列表已更新.

to tell "chosen" that the list has been updated.

这篇关于使用jQuery选择的插件提出标签建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆