Answer the question
In order to leave comments, you need to log in
Why can't select value from select2?
I posted the code here:
https://jsfiddle.net/vzexw4ky/24/
The essence is this - I enter a search, I select a value from the list, but it is not selected. The received data is correct, I checked it many times already. If you just add an option inside the select, then everything is fine.
Answer the question
In order to leave comments, you need to log in
doc should read
https://select2.org/programmatic-control/events
$('#basic').on('select2:select', function (e) {
var data = e.params.data;
console.log('on select:')
console.log(data);
//console.log('on select: ' + $(this).val());
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question