开发者

How to get added token id, name list from the jquery-tokeninput plugin via Javascript?

开发者 https://www.devze.com 2023-03-20 14:39 出处:网络
How can I get the 开发者_C百科id, name value pairs of the tokens (entered by a user) via Javascript from the jquery-tokeninput plugin found here? https://github.com/loopj/jquery-tokeninput

How can I get the 开发者_C百科id, name value pairs of the tokens (entered by a user) via Javascript from the jquery-tokeninput plugin found here? https://github.com/loopj/jquery-tokeninput

Is it just me or isnt it surprising that this plugin has a lot of features except a straight forward getEnteredTokens() method?

Thanks in advance.


I know this is kind of late coming, but have you tried:

selector.tokenInput("get");

for example:

var selectedValues = $('#myinputbox').tokenInput("get");

(where selector is whatever jQuery selector you need to return the tokeninput input object) It returns all of the currently selected id/name values in an object.

0

精彩评论

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

关注公众号