The new TextboxList is here

It’s been some time since TextboxList got some attention. It is undoubtedly one of my most popular JavaScript projects, along with the famous Fancy Menu (MorphList) and its slideshow sibling, BarackSlideshow.

TextboxList (demo) has been rewritten from scratch, and it’s more solid than ever. The first time around, elegance was not one of the goals. I focused on releasing the first open source script that reproduced the Facebook’s tokenizer.

Let’s see the new changes:

TextboxList

  • Compatible with MooTools 1.2.x
  • New options, such as addOnEnter, which adds boxes upon pressing enter (useful for tags or categories widgets).
  • More events, which gives the developer more power to extend it.
  • Each element is now identified by an id, a plain value and a HTML value.
  • Use of control, alt, meta keys no longer interfere with the elements keyboard navigation.
  • Bugs with text selection fixed.
  • Improved API, even more extensible.
  • Plugins support

Textboxlist.Autocomplete

This is the most important official plugin. It also has been rewritten, and packs new features:

  • Flexible. It does not depend on a specific data source (XHR, Json). Instead, the developer supplies the data which can come from anywhere.
  • Binary search for maximum performance
  • Simpler CSS with comments for non-experienced developers.

Without further ado, head to the project page to check out the demos and downloads.

Displaying only a subset of the comments. Click here to display all comments.

  1. Hi, I have two questions:
    (1) How do I completely reset the box? I’ve tried removing it from the DOM and using new TextboxList(…) again, but the old input remains.
    (2) When I use a autocomplete suggestion, I cannot use it again, which is good; but when I delete it from the box, I still can’t use it again. I guess this is a bug.
    Thanks!

    • I decided to have a look at the code today.

      Solved (1) by removing all but the last child from .textboxlist-bits
      Solved (2) by setting unique to true to circumvent the bug.

      Has this project been discontinued, or else why do you ignore questions in spite of the fact that you charge for it?

    • Guillermo Rauch about 1 year ago

      (1) That was the way to do it, nothing magical there nor unexpected.

      (2) I’ll be releasing the fix soon, and solutions have been posted here.

    • (1) I removed all the elements bt the last child form .textboxlist-bits and it solved my problem for removing all the elements from the textbox.

      (2) But I also want to see all the suggestions even those which were entered earlier before clearing the autocomplete textbox. After I clear (as mentioned in point 1)I can not see my suggestions which were previously entered. The earlier posts mentions to use “unique”, but I am unable to understand that, a sample code would really help to understand