Nilesh Patil

Nilesh Patil

  • 550
  • 2.9k
  • 33.5k

Select items in multiselect dropdown list MVC3 jquery

Jan 16 2018 5:31 AM
Hi All,
 
I have multi slect dropdown list i want ot on page load selected value need to display by defalut ike this
 
 
I have retuen below Ajax call
 
$(document).ready(function () {
var DocId = $("#FolderId").val();
alert(DocId);
$.ajax({
url: getDocumentAuthorOnClick,
type: "GET",
data: { id: DocId },
dataType: "JSON",
})
.success(function(result) {
var array = result;
$.each(array, function (i) {
$("#Authors").val(array); // This is not display value as selected by defalut
alert(array[i]);
});
})
 
suggest proper syntax for that

Answers (2)