如何通过 Javascript 从 jquery-tokeninput 插件获取添加的令牌 id、名称列表?

发布于 2024-11-24 02:04:17 字数 267 浏览 6 评论 0原文

如何通过 Javascript 从此处找到的 jquery-tokeninput 插件获取令牌的 id、名称值对(由用户输入)? https://github.com/loopj/jquery-tokeninput

是我个人的问题还是这并不令人惊讶除了直接的 getEnteredTokens() 方法之外,这个插件还有很多功能吗?

提前致谢。

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.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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想念有你 2024-12-01 02:04:17

我知道这有点晚了,但是你尝试过吗:

selector.tokenInput("get");

例如:(

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

其中 selector 是你需要返回 tokeninput 输入对象的任何 jQuery 选择器)
它返回对象中当前选定的所有 id/name 值。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文