问题描述
我正在使用 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 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)