我一直在查看一些关于在下拉列表中使用 BootStrapValidtor 的教程并找到了一个示例,但它无法验证下拉列表,而且我也遇到了验证 kendoUI 多选的问题。
现在我的多选标记是这个
<div class="form-group">
<label for="ddAdministrationManufacturerCatalog" class="control-label col-md-2" id="lblAdministrationClientCatalogMultiSelect"><b>Catalog</b></label>
<div class="col-md-8">
<select id="msManufacturerCatalogs" multiple name="catalog"></select>
</div>
</div>
在我的这个多选的验证器脚本中,特别是这个..
catalog: {
message: "Catalog is required",
validators: {
notEmpty: {
message: "Please choose a catalog"
}
}
}
我对剑道下拉列表的标记是这样的
<div class="form-group">
<label for="acCountries" class="control-label col-md-2" id="lblAdministrationManufacturerCountry"><b>Country</b></label>
<div class="col-md-10">
<select id="acCountries" class="form-control" name="country"></select>
</div>
</div>
它的验证器脚本部分是这个
country: {
message: "Country is required",
validators: {
notEmpty: {
message: "Please provide a Country"
},
greaterThan: {
value: 0,
message: "Required"
}
}
}
我正在创建多选
function CatalogDropDown(manufacturerCatalogs) {
$("#msManufacturerCatalogs").kendoMultiSelect({
dataSource: manufacturerCatalogs,
dataTextField: "CatalogName",
dataValueField: "CatalogID"
});
}
我的下拉列表是这个
function ShowCountries(countryData) {
$("#acCountries").kendoDropDownList({
dataSource: countryData,
dataTextField: "dictionaryName",
dataValueField: "dictionaryItemID",
animation: {
close: {
effects: "zoom:out",
duration: 500
}
},
optionLabel: {
dictionaryName: "-- Select Country --",
dictionaryItemID: "0"
}
});
}