Single-Site License $19.99

1 site, 1 server No source distribution Commercial use allowed No modifications Read full license

Multi-Site License $299.99

Unlimited sites, servers No source distribution Commercial use allowed Can modify source Read full license

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

Starting from $ 19.99

View Pricing 14 days money-back guarantee
(4 ratings)

TextboxList for jQuery

Provides a facebook style innovative interface for selecting items from an autocomplete that become "tokens", such as usernames, emails and tags. Can be used for search, contact selection and more.

Description

TextboxList turns normal text inputs into a widget that can be navigated using the keyboard, effectively turning your input into a "list" of items that can be easily deleted. It comes with an auto-complete plugin.

Demo

Full API docs

Back to top

How to use

How to use

TextboxList is essentially very easy to use, but is extremely configurable and extensible. Let's review some sample usage scenarios:

new TextboxList('form_tags_input');

This turns the an input with an id of "form_tags_input" into a TextboxList widget. By default, as shown in the demo, the user can add new boxes by pressing enter, write between boxes, delete them with backspace and delete keys. Additionally, a delete button is shown in each of the added items. All these behaviors can be configured, as shown in the sections below.

var t = new TextboxList('form_tags_input');
 t.add('Tag 1').add('Tag 2').add('Tag 3');

In this example we call the public add() method of the TextboxList instance to add items from JavaScript.

Read more in the API Docs

Back to top

Examples

// Standard initialization
var t = new $.TextboxList('#form_tags_input', {  });
t.add('Tag 1').add('Tag 2').add('Tag 3');               

// With custom adding keys 
var t2 = $('#form_tags_input_2').textboxlist({bitsOptions:{editable:{addKeys: [188]}}});

// Autocomplete initialization
var t4 = new $.TextboxList('#form_tags_input_3', {unique: true, plugins: {autocomplete: {}}});
t4.add('John Doe').add('Jane Roe');

// sample data loading with json, but can be jsonp, local, etc. 
// the only requirement is that you call setValues with an array of this format:
// [
//  [id, bit_plaintext (on which search is performed), bit_html (optional, otherwise plain_text is used), autocomplete_html (html for the item displayed in the autocomplete suggestions dropdown)]
// ]
// read autocomplete.php for a JSON response exmaple
t4.getContainer().addClass('textboxlist-loading');              
$.ajax({url: 'autocomplete.php', dataType: 'json', success: function(r){
    t4.plugins['autocomplete'].setValues(r);
    t4.getContainer().removeClass('textboxlist-loading');
}});                

// Autocomplete with poll the server as you type
var t5 = new $.TextboxList('#form_tags_input_4', {unique: true, plugins: {autocomplete: {
    minLength: 2,
    queryRemote: true,
    remote: {url: 'autocomplete2.php'}
}}});
t5.add('John Doe').add('Jane Roe');

See those example live in the demo page (view source code)

Read all 3 comments »

Questions & Comments

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
You must be logged-in to vote. Log-in to your account or register now.
View all 4 reviews »

User Reviews

    This is extremely powerful and easy to implement. There are plenty of options to make sure it fits your needs.
    - Rich Chang, 1 month ago
    Flag review
    Was this helpful? Yes No
    good
    - inarli, 6 months ago
    Flag review
    Was this helpful? Yes No
    Needs a "clear all" method. I implemented one myself but for a non-free product, it was disappointing to see such an obvious method missing. And if it did exist, I did not know it as the documentation is terrible and there is no real API doc I could find. However, that bring said, the component did work as advertised and saved me some time for sure.
    - Ben Ford, 1 year ago
    Edit Flag review
    Was this helpful? Yes No

Starting from $ 19.99

View Pricing 14 days money-back guarantee