I am trying to implement Bootstrap Tokenfield with Jquery Ui autocomplete and so far i was able to do that except the fact that i am not able to prevent duplicates in the input
I think you've done it all, all you are left to do is to replace the class
So after the first code, instead of the second code write
$('.tokenfield').on('tokenfield:createtoken', function (event) {
var existingTokens = $(this).tokenfield('getTokens');
$.each(existingTokens, function(index, token) {
if (token.value === event.attrs.value)
event.preventDefault();
});
});
The difference here is your class that has to be applied and it works both for Twitter Typeahead and Jquery Ui