Jquery Token Input - allowCustomEntry not working

2019-03-04 14:36发布

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条回答
趁早两清
2楼-- · 2019-03-04 15:35

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.

查看更多
登录 后发表回答