Jquery Token Input - allowCustomEntry not working

烂漫一生 提交于 2019-12-04 06:06:31

问题


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?


回答1:


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.)

I imagine you'll want to set allowFreeTagging:true as well, and scrap allowCustomEntry.



来源:https://stackoverflow.com/questions/23974977/jquery-token-input-allowcustomentry-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!