问题描述
我用的jQuery插件Tokeninput,让TextBox中自动完成。我想prevent用户从选择重复的单词自动完成客栈的下拉。
I use the jquery plugin Tokeninput that allow autocomplete in textBox. I would prevent user from selecting duplicate words inn the dropdown of autocomplete.
没有任何人有任何建议来解决这个问题呢?
Does anybody have any suggestion to resolve this problem?
非常感谢在前进。
推荐答案
它看起来像有是preventDuplicates其中prevents用户通过此设置为true,在选择重复的值设置。默认值是假的,你想设置为true。
It looks like there is a setting for preventDuplicates which prevents user from selecting duplicate values by setting this to true. The default is false, you would want to set the to true.
$(document).ready(function() {
$("#demo-input").tokenInput("path/to/list", {
preventDuplicates: true
});
});
您还可以看到演示在这里:的。希望这有助于
You can also see the demo here: http://loopj.com/jquery-tokeninput/demo.html#prevent-duplicates. Hope this helps
这篇关于与jQuery插件Tokeninput问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!