向jquery选择的插件添加新值

时间:2015-03-10 06:14:27

标签: jquery jquery-plugins jquery-chosen

在我的应用程序中,我使用了Jquery Chosen插件,它在我们的表单中提供了一些漂亮的多个选择。 select可以填充一些选项,用户可以选择其中一个或多个。

enter image description here

最近,在使用此插件时,我希望允许用户动态地将自己的值添加到列表中。目前,如果结果中没有值,则会显示“未找到结果”消息。

enter image description here

1 个答案:

答案 0 :(得分:0)

使用版本

// Chosen, a Select Box Enhancer for jQuery and Protoype
// by Patrick Filler for Harvest, http://getharvest.com
// 
// Version 0.9.5
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com

// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
// This file is generated by `cake build`, do not edit it by hand.

HTML

 <select data-allows-new-values="true" 
style="width: 100%;" class="chzn-select-desele selLoc " >
                        </select>
相关问题