Home > jquery.taglist

jquery.taglist

Jquery.taglist is a project mainly written in JavaScript, it's free.

Simple tag list editor that converts the tags to blocks as you type

Taglist (for jQuery) version: 0.4 (3/15/2010) @requires jQuery v1.4 or later

Examples at http://jeffrafter.github.com/jquery.taglist

Licensed under the MIT: http://www.opensource.org/licenses/mit-license.php

Copyright 2011 Jeff Rafter

Input resizing based on http://jsbin.com/ahaxe

Makes an editable taglist that adds items as blocks

Usage:

< class="taglist">

Advanced:

If you want to have long tags (with spaces) you can simply set the keyCodes and delimiter options to be empty and jquery.taglist will insert a JSON version of the tags into the value:

$('input.taglist').taglist([], {keyCodes: null, delimiter: null})

Additionally, jquery.taglist has several callbacks for you to handle things how you want:

$('input.taglist').taglist([], { onAdd: function(tag) {}, onRemove: function(tag) {}, onProcess: function(tag) {} })

The process callback is useful for implementing validation or custom splitting logic. If included, the default processor (which adds the tag) will not be called. So be sure to call this.addTag(tag).

Available options:

className: the class that should be used for each new tag in the list

prefixUrl: the base url inside of each tag href (the tag text is encoded and added)

inputType: overridable input type (default is "text"), so you can use HTML 5 style inputs

keyCodes: a list of key codes that trigger tag processing. For example, [188, 0] are the keyCodes for "," and " " respectively

delimiter: the default tag delimiter (" " by default). This will be used when splitting and building up the input value.

Previous:boost