Jquery令牌输入 - allowCustomEntry不工作 [英] Jquery Token Input - allowCustomEntry not working
问题描述
我使用的Jquery令牌输入版本1.6.0。我想能够在令牌输入中输入自定义条目,但每次我这样做表单提交(我键入自定义单词并按Enter键)。这是我的代码(在coffeescript):
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
b $ b
一切正常,除了自定义条目...任何想法我做错了什么?
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不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!