Jquery Token Input - allowCustomEntry not working(Jquery 令牌输入 - allowCustomEntry 不起作用)
问题描述
我正在使用 Jquery Token Input 版本 1.6.0.我希望能够在令牌输入中输入自定义条目,但每次我这样做时都会提交表单(我输入自定义单词并按 Enter).这是我的代码(在咖啡脚本中):
I am using Jquery Token Input version 1.6.0. I would like to be able to enter custom entries into the token-input, but everytime I do so the form submits (I type a custom word and hit enter). Here is my code (in coffeescript):
jQuery ->
$('[id$=tag_list_tokens]').each ->
el = $(this)
el.tokenInput '/listings/tags.json',
theme: 'facebook'
minChars: 1
allowCustomEntry: true
preventDuplicates: true
prePopulate: el.data('load')
allowFreeTagging: false
除了自定义条目外,一切正常……知道我做错了什么吗?
Everything works fine except for the custom entries...any idea what I'm doing wrong?
推荐答案
allowFreeTagging
1.6.0 版本未实现.从 Github 下载 v1.6.1.(TokenInput 网站已经过时了几年.)
allowFreeTagging
wasn't implemented by version 1.6.0. Download v1.6.1 from Github. (The TokenInput website is a few years out of date.)
我想你也想设置 allowFreeTagging:true
,然后废弃 allowCustomEntry
.
I imagine you'll want to set allowFreeTagging:true
as well, and scrap allowCustomEntry
.
这篇关于Jquery 令牌输入 - allowCustomEntry 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Jquery 令牌输入 - allowCustomEntry 不起作用


- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01