im using jquery bootstrap-tagsinput
and currently the only method for creating a tag is by hitting the enter key after typing it in. What I am looking for is a more easy user method of creating the tags. I was thinking that I could do an onblur
somewhere in the bootstrap-tagsinput.js
file.
Can someone assist?
bootstrap tagsinput
Thanks.
You can modify the plugin itself (bootstratp-tagsinput.js) and add on blur event (I pretty much copied this one from on keydown event):
self.$container.on('blur', 'input', $.proxy(function(event) {
var $input = $(event.target);
if (self.options.freeInput) {
self.add($input.val());
$input.val('');
event.preventDefault();
}
// Reset internal input's size
$input.attr('size', Math.max(this.inputSize, $input.val().length));
}, self));