Insignia

Customizable tag input. Progressive. No non-sense!

Fork me on GitHub
      
insignia(input);
      
    
      
insignia(input, {
  delimiter: ','
});
      
    
      
insignia(input, {
  deletion: true
});
      
    
      
insignia(input);
      
    
      
insignia(input, {
  getText: function (value) {
    return value.toUpperCase();
  }
});
      
    
      
insignia(input, {
  validate: function (value, tags) {
    return true;
  }
});
      
    
      
insignia(input, {
  getText: function (value) {
    return value.toUpperCase();
  },
  validate: function (value, tags) {
    return true;
  }
});
      
    
      
insignia(input);
      
    
      
var tagInput = insignia(input);

// insignia.find(input) also returns tagInput

toggle.addEventListener('click', function () {
  if (tagInput.destroyed) {
    tagInput = insignia(input);
  } else {
    tagInput.destroy();
  }
});
      
    
(but we wouldn't endorse doing that in forms, as it'd break the default submit behavior!)
      
var tagInput = insignia(input);

input.addEventListener('keypress', function (e) {
  if (e.keyCode === 13) {
    tagInput.refresh();
    e.preventDefault(); // prevent form submission
  }
});
      
    

Get it on GitHub! bevacqua/insignia