jquery autosuggest用于单个文本框中的多个单词 [英] jquery autosuggest for multiple words in single textbox
问题描述
如何配置Jquery autosuggest插件以支持单个文本框中的多个单词。
how to cofigure the Jquery autosuggest plugin to support for multiple words in a single textbox.
例如。如果我想在文本框中键入STACK OVERFLOW。因为我开始键入ST ..它应该自动提供STACK和空格后,如果我输入OV ..它应该显示OVERFLOW。
Eg. If i want to type "STACK OVERFLOW" in a textbox. as i start typing ST.. It should autosuggest for "STACK" and after space, if i type OV.. It should show OVERFLOW.
我需要在单个文本框中为单个单词配置自动提示。
I need to configure autosuggestion for individual words in a single textbox.
注意:我不想显示STACK OVERFLOW作为开始输入ST。
NOTE: I dont want to show STACK OVERFLOW as start entering "ST".
类似于Stackoverflow中的Tags建议,但不是单个单词的标记。
Similar to "Tags" suggestion in Stackoverflow, but not a tag as individual word.
推荐答案
您可以使用Jquery UI,可在此处找到:
You can use the Jquery UI which can be found here:
http://jqueryui.com/demos/autocomplete/#multiple
它会给你一个例子在单个文本框中有多个单词。
It'll show you an example to have multiple words in a single textbox.
至于从OVERFLOW中分离STACK,你可以通过在你给插件的源值中分离它们来做到这一点,例如:
As for seperating the STACK from OVERFLOW, you can do that by separating them in the source value you give the plugin, such as:
var source = ["STACK","OVERFLOW"];
这将建议他们独立。
我希望这会有所帮助。
这篇关于jquery autosuggest用于单个文本框中的多个单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!