Hello,
I´m triying to set a multiple select with value coming from a database and I can´t find the rigth way to do it. What I´m trying to do is :
var valoresArea=VALUES // it has the multiple values to set, separated by comma
valoresArea=valoresArea.replace(',','","');
valoresArea='"' + valoresArea + '"';
var arrayArea = valoresArea.split(','); //arrayArea[0]="ItemtoSelect1";arrayArea[1]="ItemtoSelect2"
$('#area').val(arrayArea);
But this does not work. However if I set the values manually, I mean
$('#area').val(["ItemtoSelect1","ItemtoSelect2"]);
It works!!!!!!
What can I do to make it worksss???
Thank you!