<div class="col-md-6">
<div id="selectDescription">Select Employees(s) or Administrators</div>
<div>
<select name="wd" id="wdSelect" style="width: 80%;" multiple="" class="form-control select-checkbox" size="10">
<option value="default" disabled>
None
</option>
</select>
</div>
<div>
<input name="chkSelectAll" id="chkSelectAll" type=checkbox value="" style="display:inline-block;" />
<label for="chkSelectAll" style="display:inline-block;"> Select All </label>
</div>
</div>
$('#Report').change(function () {
var empId = $("#Report").val();
var _tt = $(this).val();
$('#wdSelect').empty();
$.ajax({
type: "GET",
dataType: "json",
url: "/Report/LoadReport",
data: {empId: reportId },
success: function (data) {
if (data.selectedwd.length > 0) {
$('#selectDescription').html("Select Employees(s) or Administrators");
$("#wdSelect")[0].name = 'wd';
$.each(data.selectedwd, function(i, wd) {
$("#wdSelect").append('<option value="'
+ wd.Value + '">'
+ wd.Text + '</option>');
});
} else {
$('#selectDescription').html("Select Admins");
$("#wdSelect")[0].name = 'admin';
$.each(data.selectedadmin, function (i, wd) {
$("#wdSelect").append('<option value="'
+ wd.Value + '">'
+ wd.Text + '</option>');
});
}
},