I am binding my dropdown with Jquery-Select2
. It's working fine but now I need to bind my Multi-Value selectBox
by using Jquery-Select2
.
My DropDown
<div class="divright">
<select
id="drp_Books_Ill_Illustrations"
class="leaderMultiSelctdropdown Books_Illustrations"
name="drp_Books_Ill_Illustrations"
multiple=""
>
<option value=" ">No illustrations</option>
<option value="a">Illustrations</option>
<option value="b">Maps</option>
<option value="c">Portraits</option>
</select>
</div>
From this link http://ivaynberg.github.com/select2/ I am using Multiple Value Select Box, I can bind my dropdown with
$("dropdownid").Select2()
Its working fine, but now I need to get that selected value into my dropdown on edit mode So I am using this example:
$(".Books_Illustrations").select2("val", ["a", "c"]);
It's working but how can I fix my choice, because user can choose anything. So I can't write a,c statically that's why I need to bind my Selected value on Edit mode dynamically.
I think now you all are clear with my requirements. Please let me know if you need further clearance.