Bootstrap tags input allow duplicates

Gowri picture Gowri · Mar 18, 2014 · Viewed 7.4k times · Source

I want to allow duplicates in bootstrap tags input.

<input type="text" id="y_data" name="y_data" data-provide="tag" placeholder="Add tags" />

I'm trying to add the same tag when it is exist, but it is not working.

$(function () {
    $('#y_data').tagsinput({
        onTagExists: function(item, $tag) {
            $('#y_data').tagsinput('add', item);
        }
    });
});

Is it correct way or any other solution to achieve my problem.