Click here to Skip to main content
14,243,792 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to set values to multi select drop down .
The values are getting selected but the selected value text is not displayed on the text box.

What I have tried:

ASPX page

Ajax to set the value for Multi select drop down
url: 'NewTicket.aspx/getEditDate',
data: "{'TicketId':'" + obj + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
var TicketId = data.d.TicketId;
var IssueSummary = data.d.IssueSummary;

// $('#ddlissurtopic').select2("val", IssueSummary)({
// });
///To get Issue Summary for multi select
var selectedOptions = IssueSummary.split(',');
for (var i in selectedOptions) {
var optionVal = selectedOptions[i];
$("ddlissurtopic").find("option[value=" + optionVal + "]").prop("selected", "selected");
// $("ddlissurtopic").multiselect('reload');

// var opts = IssueSummary.split(",");
// $.each(IssueSummary.split(","), function (i, e) {
// $("#ddlissurtopic option[value='" + e + "']").prop("selected", true);
// });

// $.each(opts, function (inx, val) {
// $('#ddlissurtopic option[value=' + val + ']').attr('selected', true);
// })
// $('#ddlissurtopic').val(IssueSummary);

// $('#ddlissurtopic').multiselect("refresh");
//$('#ddlissurtopic').multiSelect("select", IssueSummary);

//$('#ddlissurtopic').setAttribute("aria-hidden", "false");

// $('#ddlissurtopic').val(data.d.IssueSummary);
error: function (err) {
Updated 28-Apr-19 19:46pm
Christian Graus 29-Apr-19 1:47am
What library is providing this control?
harish kashyap01 29-Apr-19 4:01am
Christian Graus 29-Apr-19 4:22am
Can you give us a name or a URL? Your issue is with a library. My work day is slow enough that I'd look at it if you told me which one
harish kashyap01 29-Apr-19 5:05am
harish kashyap01 29-Apr-19 5:08am
the values are getting selected in multi select drop down list but not showing the selected value text in edit mode

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100