Select 2 comma separated tags

353 views
Skip to first unread message

ankit...@gmail.com

unread,
Jul 22, 2019, 4:20:43 PM7/22/19
to select2
Hello everyone,
I am using select2 for multiple value selection with auto completion. Is there any way to do this without forming tags and only have comma separated list instead. For example this:

Capture.PNG

Best regards
Ankita

Tac Tacelosky

unread,
Jul 22, 2019, 4:34:06 PM7/22/19
to sel...@googlegroups.com
If I understand correctly, you don't want the little pill-box around the selected tags, right?  I think that's just a matter of overriding the class.

Tac

--
You received this message because you are subscribed to the Google Groups "select2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/select2/29edda6c-e47e-4062-8564-c43a0ef4ea66%40googlegroups.com.

ankit...@gmail.com

unread,
Jul 22, 2019, 9:22:01 PM7/22/19
to select2
Thank you. Yes exactly. That is the requirement. I am using form-control at the moment. Do you know which class should be used in this case. (I could not find in documentation)

Marco Vellani

unread,
Jul 23, 2019, 2:32:51 AM7/23/19
to select2
I Think that you must modify/Override the CSS of select2 that contain the word "choice".
The choice class represent the selected item, so if you modify it teorically you can have the style that you want for selected item/tag.

Electric Bikes Backlinks

unread,
Dec 26, 2025, 2:40:35 AM (12 days ago) 12/26/25
to select2
  You can handle this use case in Select2 by disabling tags and using a custom tokenizer or separator logic, so users can enter comma-separated values without creating tag objects. Many developers face this exact issue when trying to balance autocomplete with clean input behavior, and documenting the workaround clearly really helps others implementing similar UI patterns. A short write-up like this would fit perfectly in practical Guides for frontend developers dealing with Select2 edge cases.  

Electric Bikes Backlinks

unread,
Jan 5, 2026, 9:42:16 AM (2 days ago) Jan 5
to select2

This is a common and interesting use case with Select2, especially when working with autocomplete and multiple selections. While Select2 is built around tag-style selections, handling comma-separated values can sometimes be managed through custom configuration or by processing the selected values before submission. Exploring workarounds like input parsing or custom adapters can be quite useful depending on the project requirements. For more step-by-step developer Guides and practical frontend solutions.

On Tuesday, 23 July 2019 at 01:20:43 UTC+5 ankit...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages