
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
bootstrap-tokenfield-jquery3
Advanced tools
Advanced tagging/tokenizing plugin for input fields with a focus on keyboard and copy-paste support.
![NPM version][npm-badge] ![Build status][travis-badge] [npm-badge]: https://badge.fury.io/js/bootstrap-tokenfield.png [travis-badge]: https://travis-ci.org/sliptree/bootstrap-tokenfield.png?branch=master
A jQuery tagging / tokenizer input plugin for Twitter's Bootstrap, by the guys from Sliptree
Check out the demo and docs
Requirements: jQuery 1.9+, Bootstrap 3+ (only CSS)
dist/bootstrap-tokenfield.js
or dist/bootstrap-tokenfield.min.js
in your HTMLdist/css/bootstrap-tokenfield.css
in your HTML$('input').tokenfield()
You can use the tokenfield:createtoken
event for that. Check the event.attrs
property for token value and label,
and the run your duplicate detection logic. If it's a duplicate token, simply do event.preventDefault()
.
Here's a simple example that checks if token's value is equal to any of the existing tokens' values.
$('#my-tokenfield').on('tokenfield:createtoken', function (event) {
var existingTokens = $(this).tokenfield('getTokens');
$.each(existingTokens, function(index, token) {
if (token.value === event.attrs.value)
event.preventDefault();
});
});
Similarly, using tokenfield:createtoken
, you can check to see if a token exists in your autocomplete/typeahead
data. This example checks if the given token already exists and stops its entry if it doesn't.
$('#my-tokenfield').on('tokenfield:createtoken', function (event) {
var available_tokens = bloodhound_tokens.index.datums
var exists = true;
$.each(available_tokens, function(index, token) {
if (token.value === event.attrs.value)
exists = false;
});
if(exists === true)
event.preventDefault();
})
See release notes
Previous releases:
0.10.0
autocomplete="off"
to prevent browser-specific autocomplete suggestionstriggerKeys
has been renamed to delimiter
and accepts a single or an array of characters instead of character codes.0.9.9-1
triggerKeys
option0.9.8
triggerKeys
option0.9.7 Valuable
prevetDuplicateToken
event0.9.5 Typeable
0.9.2 Maintenance release
0.9.0 Bootstrappable
0.7.1
0.7.0 Autocompleted
0.6.7 Crossable
0.6.5 Shiftable
0.6 Editable
0.5 Initial release
FAQs
Advanced tagging/tokenizing plugin for input fields with a focus on keyboard and copy-paste support.
We found that bootstrap-tokenfield-jquery3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.