From c655a4884318115554331d58df673e1ef647565a Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Wed, 8 Aug 2012 19:33:40 -0700 Subject: [PATCH] add a tokenizer so choices can be automatically created and selected while user is typing or pasting into the field. fixes #101 #81 #292 --- select2-latest.html | 64 +++++++++++++++++++++++++++++++++++++++++---- select2-master | 2 +- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/select2-latest.html b/select2-latest.html index 0b1bb87f..e6dc8542 100755 --- a/select2-latest.html +++ b/select2-latest.html @@ -642,11 +642,11 @@ $("#e11_2")
- +

Tagging Support

@@ -662,7 +662,31 @@ $("#e12").select2({tags:["red", "green", "blue"]});
+
+ +
+

Auto Tokenization

+

Select2 supports ability to add choices automatically as the user is typing into the search field. + This is especially convenient in the tagging usecase where the user can quickly enter a number of tags + by separating them with a comma or a space. Try typing in the search field below and entering a space or a comma

+ +

+

Note that the separators are defined in the tokenSeparators option

+

Note that this example uses the built in tokenizer function, but a custom one can be provided in the options.

+
+
+

Example Code

+
+           
+
+