开发者

jQuery autocomplete function, how to add support for words not available in the database yet?

I'm looking to implement a tag system like how SO uses on their site, where users can specify multiple tag words. However, on top of all the other autocomplete functions available as jquery plugins, I also want to allow users to enter new words开发者_JAVA百科 not in the database.

Does anyone know of any plugin that can do that? Or if there isn't, how one can add that functionality to an existing autocomplete function?

I'm exploring Drew Wilson's autosuggest plugin at the moment, as it supports multiple tags well: http://code.drewwilson.com/entry/autosuggest-jquery-plugin

Any help appreciated! Thanks :)


You can use the autocomplete plugin with mustMatch = false (which is the default). This way, input will not be limited to the database suggestions.

http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions

If you want new entries to be added to the database, you'll have to implement that on the server side (and make the appropriate call from the client) — but I'm not sure that's what you're asking.


Are you sure that the side effects will be acceptable? For example once you have 8 different spellings of the same tag it will be a problem.

Could you limit the ability to add new tags to those that have 'earnt' the responsibility using some kind of reputation system like SO uses? In this way you are less likely to get your tags all muddied up.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜