Include allowFreeTagging: true
when you initiate.
Unfortunately, the documentation hasn't been updated in a few years.
Also note that if you set allowFreeTagging
to true, you will want to change the tokenValue
to "name"
, because when you save the tag on your server, you probably want to save the name, not the id.
Here is a look at my token options
tokenOptions = {
allowFreeTagging: true,
tokenValue: 'name'
}
$('input#tag-input').tokenInput('/tags.json', tokenOptions);
This way, when a user selects tags, the names are sent to the server, and if there are any new tag names, I simply create them server-side.