gdm
gdm

Reputation: 7930

Select2 initial tags

I have been having this issue in select2. I cannot show the initial tags, as shown in select2's home page:

<input width="100px" type="text" id="e12">
<script>
  $(document).ready(function(){
 $("#e12").select2({multiple:'true',tags:["red", "green", "blue"]});
 });
</script>

But the "colors" are shown if and only if I begin typing. Otherwise, the input is blank.

Upvotes: 0

Views: 505

Answers (1)

gdm
gdm

Reputation: 7930

As simple as the hot water: I forgot to put the value in the input tag!

 <input width="100px" type="text" id="e12" value="pippo,italy">

Upvotes: 1

Related Questions