简体   繁体   English

如何禁用textboxlist来添加不在自动完成列表中的标签

[英]how to disable textboxlist from adding tags that are not in autocomplete list

i'm using jquery textboxlist plugin with autocomplete and want to: 我正在使用具有自动完成功能的jquery textboxlist插件,并希望:

  1. allow the user to type in something, and if it shows up in the autocomplete list, then the users can select it and a tag will be added to the box. 允许用户输入内容,如果该内容显示在自动完成列表中,则用户可以选择它,并且标签会添加到框中。
  2. if what the user typed is not in the autocomplete (suggestion) list, then the input should be ignored. 如果用户键入的内容不在自动完成(建议)列表中,则应忽略输入。

right now when the user types in something that is not in the autocomplete list, it selects a tag that is closest to what the user has typed, how do i disable this behavior? 现在,当用户键入的内容不在自动完成列表中时,它会选择与用户键入的内容最接近的标签,如何禁用此行为?

example: auto complete list has words: party, plan when the user types: "peek", it pics up "party" and adds it to the box. 示例:自动完成列表中的单词:party,当用户键入:“ peek”时计划,它会显示“ party”并将其添加到框中。 I want it to ignore this input. 我希望它忽略此输入。

any ideas? 有任何想法吗? thanks. 谢谢。

set following setting in auto complete call 在自动完成通话中设置以下设置

mustMatch: true, //for only existing value in list mustMatch:true,//仅适用于列表中的现有值

selectFirst :false, // do not select first matching one selectFirst:false,//不选择第一个匹配的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM