我正在使用 Jquery token 输入版本 1.6.0。我希望能够在 token 输入中输入自定义条目,但每次这样做都会提交表单(我输入自定义单词并按 Enter 键)。这是我的代码(在 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
除了自定义条目之外,一切正常...知道我做错了什么吗?
最佳答案
版本 1.6.0 未实现
allowFreeTagging
。下载v1.6.1来自Github。 (TokenInput 网站已经过时了几年。)
我想您也想设置 allowFreeTagging:true
,并废弃 allowCustomEntry
。
关于javascript - Jquery token 输入-allowCustomEntry 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23974977/