Tagbox

Select items from lists with autocomplete

View the Project on GitHub jbt/tagbox

Simple token-based input with fuzzy matching

Example: Select a list of countries

Value:

$('#example_1').tagbox({
  items: countryList,
  rowFormat: '{{text}}',
  tokenFormat: '{{text}}',
  searchIn: [ 'text', 'code' ]
});

Example: Choose just one country

Value:

$('#example_2').tagbox({
  items: countryList,
  className: 'single',
  maxItems: 1,
  rowFormat: '{{text}}',
  tokenFormat: '{{text}}',
  searchIn: [ 'text', 'code' ]
});

Example: Allow new items

Try typing something not already in the list.

Value:

$('#example_3').tagbox({
  items: [ { value: 'cat' }, { value: 'dog' }, /* etc... */ ],
  allowNew: true
});

Options

Download