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 不起作用


基础教程推荐
- 如何添加到目前为止的天数? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01