Bootstrap multiselect仅保存第一个选项

时间:2018-02-09 17:03:33

标签: javascript twitter-bootstrap bootstrap-multiselect

我在Asp.Net项目中实现了bootstrap multiselect。但它显然在表单中选择了多个选项,但是当我保存它时,只保存第一个选项。如果我从其他选项中取消选择一个选项,则选择多个选项时会显示未选中。 我添加了这个HTML:

<div class="form-group">
        <label class="col-sm-3 control-label" for="SecondaryLicenseStatuses">Secondary License Statuses:</label>
        <div class="col-sm-9">
            <select class="form-control" id="SecondaryLicenseStatuses" data-bind="options: TabLicense.SecondaryLicenseStatuses, selectedOptions: TabLicense.SecondaryLicenseStatusesSelections, optionsText: 'name'" size="5" multiple="multiple"></select>
        </div>
    </div>

并添加了此javascript

$('#SecondaryLicenseStatuses').multiselect({
    includeSelectAllOption: true
});

输出: 当我选择3个选项时,它只在顶部显示NRE

when I select 3 options, It shows only NRE on top

当我选择3个选项并取消选择一个它显示如下

when I select 3 options and deselect one it shows like this

0 个答案:

没有答案