Add values to a chosen multiselect

后端 未结 3 1128
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-07 06:16

I am wondering whether it\'s possible to add new values on the fly to a chosen.js multiselect (similar to how tagging works).

I\'ve seen in another SO post a user s

3条回答
  •  没有蜡笔的小新
    2021-01-07 06:45

    The problem you have is because you haven't follow the steps in the documentation:

    If you download the source, install the correct packages and run the build commands you end with a chosen.jquery.js, chosen.proto.js and chosen.css.

    So the following steps should do it for you:

    1. Download: https://github.com/koenpunt/chosen/archive/option_adding.zip
    2. Install packages: npm install && gem install bundler && bundle install
    3. Run build: grunt build (note, for this you'll need the grunt cli)

    Edit

    Or for your convenience, download a compiled release.

提交回复
热议问题