Good afternoon guys, I'm working with a multiple select2, the problem I have is that when inento changes the value of the element (which should be 3 items) this only chooses the first of the array, here my code:
Creation of the select2 element:
{{ Form::select('puntos_venta[]', $puntos, '', array('id' => 'puntos_venta', 'class' => 'form-control', 'style' => 'width: 100%;', 'multiple' => '')) }}'
How I change the values with javascript:
var puntos = "9,7,8"; //A manera de ejemplo
$('#puntos_venta').select2('val', puntos.toString().split(','));
For this case, then I only select the first element, that is, the one that has ID 9. I hope you can help me.