Skip to content

Commit

Permalink
fixed duplicating id
Browse files Browse the repository at this point in the history
  • Loading branch information
vgichar committed Apr 14, 2015
1 parent 70486a4 commit 02b65a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jquery.tagsinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@
inputPadding: 6*2
},options);

var uniqueIdCounter = 0;

this.each(function() {
if (settings.hide) {
$(this).hide();
}
var id = $(this).attr('id');
if (!id || delimiter[$(this).attr('id')]) {
id = $(this).attr('id', 'tags' + new Date().getTime()).attr('id');
id = $(this).attr('id', 'tags' + new Date().getTime() + (uniqueIdCounter++)).attr('id');
}

var data = jQuery.extend({
Expand Down

0 comments on commit 02b65a9

Please sign in to comment.