我有一个asp dropdownlist <asp:DropDownList ID="ddIndProvince" data-style="btn-default" CssClass="form-control input" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddIndProvince_SelectedIndexChanged" TabIndex="8"></asp:DropDownList>
页面加载事件我在索引0处插入了“--Select--”项目。 现在我遇到了问题,我正在使用引导验证器。它的返回值对“ - 选择 - ”项有效。像下面的图片。 使用引导验证器验证ASP.NET Dropdownlist控件
如何this.Below我们我当前的脚本
<script type="text/javascript">
$(document).ready(function() {
$('#form1').bootstrapValidator({
container: '#messages',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
<%=ddIndProvince.UniqueID%>:{
validators:{
notEmpty:{
messages:'please select province'
}
}
}
}
});
});
</script>
很好用!谢了哥们! –