jQuery tags input plugin based on Twitter Bootstrap.

Overview

Bootstrap Tags Input Build Status

Bootstrap Tags Input is a jQuery plugin providing a Twitter Bootstrap user interface for managing tags.

Current stable version: v0.8.0

Usage

Examples can be found here.

Features

  • Objects as tags
  • True multi value
  • Typeahead
  • Designed for Bootstrap 2.3.2 and 3

Objects as tags

Not just support for using strings! This means you can use different values for a tag's label and value. Each tag also holds a reference to the object by which it was created, so by calling tagsinput('items') an array of the original items is returned.

True multi value support

Other implementations just concatenate the values to a comma separated string. This results in val() returning just this string, and when submitting the form, only one big, concatenated value is sent in the request.

Bootstrap Tags Input provides true multivalue support. Just use a <select multiple /> as your input element, and val() will return an array of the tag values. When submitting the form, an array of values will be sent with the request.

Typeahead support

Integrates with Twitter Bootstraps' 2.3.2 typeahead, or use custom typeahead when using Bootstrap 3.

Development

Install dependencies:

npm install
grunt install

Test:

grunt test

Build:

grunt build

Current Library Versions:

  • Bootstrap: 3.3.5
  • jQuery: 2.1.4
  • Typeahead: 0.11.1

Libraries for testing go in the /lib directory.

History

License

This project is licensed under MIT.

Comments
  • Troubles installing package via github url and tag

    Troubles installing package via github url and tag

    Hello,

    something happend yesterday. I have troubles installing this package via tag:

    "bootstrap-tagsinput": "[email protected]:bootstrap-tagsinput/bootstrap-tagsinput#0.8.0" or "bootstrap-tagsinput": "https://github.com/bootstrap-tagsinput/bootstrap-tagsinput.git#0.8.0",

    yarn can not resolve it: image

    opened by dvinci-klfr 1
  • Replacing a tag in an event beforeItemAdd

    Replacing a tag in an event beforeItemAdd

    I use this code but it doesn't do what I want :-) $('#tagsinput').on('beforeItemAdd', function(event) { event.item = event.item.replace(/\s\s+/ig, "").replace(/:\/\//ig, "").replace(/https/ig, "").replace(/http/ig, "").replace(/ftp/ig, ""); }); How is it possible to implement it? Thank you!

    opened by evgeniyefimchenko 0
  • how to custom typeaheadjs suggestion?

    how to custom typeaheadjs suggestion?

        $('#userList').tagsinput({
            itemValue: 'userId',
            itemText: `display`,
            typeaheadjs: {
                name: 'cpoUserList',
                display: 'display',
                source: cpoUserList.ttAdapter(),
                template: {
                    suggestion: function (data) {
                        return `<div><strong>${data.userName}</strong> - ${data.loginId}</div>`
                    }
                }
            }
        });
    

    this code is not work. how to custom typeaheadjs suggestion?

    opened by ahnjoonheon 0
  • Use prop() and val() instead of attr()/removeAttr()

    Use prop() and val() instead of attr()/removeAttr()

    Use prop() and val() instead of attr()/removeAttr().

    As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

    opened by shirayuki 0
  • [Feature Suggestion] Allow configuration via `data-` attributes

    [Feature Suggestion] Allow configuration via `data-` attributes

    Currently, when needing to create tagsinputs with any options we need to destroy/re-create the tagsinput elements that are created when select tags contain the data-role=tagsinput data attribute. To avoid this, plus to add a very useful way to create tailored tagsinputs without needing any javascript (just the data-role=tagsinput data attribute), I'd like to suggest an improvement that would allow settings most of the settings via data attributes.

    This has been done on various packages for convenience sake. Example: bootstrap-datetimepicker

    My thinking is to use the same standard camelCase-to-hyphenated approach:

    | Option | data- Attribute Equivalent | | -------- | ----------------------------- | | tagClass | data-tag-class | | tagClass | data-tag-class | | itemValue | data-item-value | | itemText | data-item-text | | maxTags | data-max-tags 1 | | confirmKeys | data-confirm-keys 2 | | maxChars | data-max-chars 1 | | trimValue | data-trim-value 3 | | allowDuplicates | data-allow-duplicates 3 | | focusClass | data-focus-class | | freeInput | data-free-input 3 | | cancelConfirmKeysOnEmpty | data-cancel-confirm-keys-on-empty 3 |

    1: These would need to be cast to numbers 2: The value would need to be a comma-separated list, which would be split to create the array. 3: There are multiple ways to handle booleans, but the easiest is to just do string comparison against "true"/"false".

    The only two options that would be omitted are typeahead and onTagExists, unless someone can think of a way to incorporate those.

    Thoughts?

    opened by caffeinatedMike 0
A Bootstrap plugin to create input spinner elements for number input

bootstrap-input-spinner A Bootstrap / jQuery plugin to create input spinner elements for number input. Demo page with examples Examples with floating-

Stefan Haack 220 Nov 7, 2022
Extends Bootstrap Tooltips and Popovers by adding custom classes. Available for Bootstrap 3 and Bootstrap 4.

Bootstrap Tooltip Custom Class Extends Bootstrap Tooltips and Popovers by adding custom classes. Available for Bootstrap 3 and Bootstrap 4. Define you

Andrei Victor Bulearca 14 Feb 10, 2022
A simple Form Validation Utility for Bootstrap 3, Bootstrap 4, and Bootstrap 5 for Humans.

bootstrap-validate A simple Form Validation Utility for Bootstrap 3, Bootstrap 4, and Bootstrap 5 for Humans. ?? Support us with Developer Merchandise

null 138 Jan 2, 2023
🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue

Tagify - tags input component Transforms an input field or a textarea into a Tags component, in an easy, customizable way, with great performance and

Yair Even Or 2.8k Jan 2, 2023
A Pure JavaScript Solution to create Tags Input Element.

JavaScript Tags Input Library Native JavaScript library to make Tags Input Element in DOM. There isn't any dependency for this library, add it straigh

Qamar ALi 11 Jun 27, 2022
Tag cloud plugin for jQuery, showing bigger tags in the center

jquery.tagcloud v1.2.0 Tag cloud plugin for jQuery, showing bigger tags in the center. Usage There are two ways to define a tag cloud: Use ul and li H

Peter Thoeny 1 Jun 30, 2022
Picky is a jQuery plugin that provides simple client-side date validation when entering dates using select tags.

jquery.picky.js Picky is a jQuery plugin that provides simple client-side date validation when entering dates using select tags. Features Instead of g

Patrick Crowley 5 Apr 25, 2021
This plugin integrates by default with Twitter bootstrap using badges to display the maximum lenght of the field where the user is inserting text. Uses the HTML5 attribute "maxlength" to work.

Bootstrap MaxLength This plugin integrates by default with Twitter bootstrap using badges to display the maximum length of the field where the user is

Maurizio 772 Dec 25, 2022
Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.

Bootstrap Colorpicker Bootstrap Colorpicker is a modular color picker plugin for Bootstrap 4. THIS PROJECT IS NOT MAINTAINED ANYMORE. After almost 10

Javi Aguilar 1.4k Dec 22, 2022
A phone input component that uses intl-tel-input for Laravel Filament

Filament Phone Input This package provides a phone input component for Laravel Filament. It uses International Telephone Input to provide a dropdown o

Yusuf Kaya 24 Nov 29, 2022
jquery-input-mask-phone-number.js - A simple, easy jquery format phone number mask library

jquery-input-mask-phone-number A jQuery Plugin to make masks on input field to US phone format. Quick start 1. Add latest jQuery and jquery-input-mask

Raja Rama Mohan Thavalam 12 Aug 25, 2022
Simple tag input for Bootstrap

Tagin Simple tag input for Bootstrap. Supports bootstrap v4 and v5. Demo: https://tagin.netlify.app/ Features Custom separators Enable/disable duplica

Erwin Heldy G 37 Sep 28, 2022
An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.

bootstrap-fileinput An enhanced HTML 5 file input for Bootstrap 5.x, 4.x, and 3.x with file preview for various files, offers multiple selection, resu

Kartik Visweswaran 5.2k Jan 3, 2023
Bootstrap 5 spinner/loading/pending indicator for ,