admin管理员组文章数量:1323177
How can I get the id, name value pairs of the tokens (entered by a user) via Javascript from the jquery-tokeninput plugin found here?
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.
How can I get the id, name value pairs of the tokens (entered by a user) via Javascript from the jquery-tokeninput plugin found here? https://github./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.
Share Improve this question asked Jul 14, 2011 at 17:50 HarindakaHarindaka 4,9088 gold badges47 silver badges66 bronze badges 2-
On the demo page, you can get the ids using
$('#tokeninput-demo').val()
: loopj./jquery-tokeninput. – pimvdb Commented Jul 14, 2011 at 17:55 - Thanks but this would just give me a ma seperated id list wouldnt it? The ids would be of type string and not the original type which was passed via a JSON array (since val() gets the value of the input type=text ). I need the id,name pairs entered as an array and in their original type. – Harindaka Commented Jul 14, 2011 at 18:46
1 Answer
Reset to default 7I know this is kind of late ing, 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.
本文标签:
版权声明:本文标题:How to get added token id, name list from the jquery-tokeninput plugin via Javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742134338a2422303.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论