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.
Only change the default to allowDuplicates: true