Nilesh Patil

Nilesh Patil

  • NA
  • 3k
  • 114.7k

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)