select2 display not updating label text but value is changing

34 views
Skip to first unread message

aman.1...@gmail.com

unread,
Jul 23, 2016, 1:37:31 PM7/23/16
to select2

I am using select2 v4.0.3 along with JQuery. I initialize my selectors as:

$("#datatype").select2({
theme: "classic"
});

$("#unit").select2({
theme: "classic"
});
Then I want to detect a change on #datatype and change the value of #unit which I do as follows:

$("#datatype").on('select2:select',function () {
$("#unit").val('21'); //udpate unit type to be 'none'
});


The problem is that the value of #unit is getting set to 21 but the displayed label for that selector is not updating. Any suggestions ?

Reply all
Reply to author
Forward
0 new messages