成功后,验证器将 div 显示为黑色而不是绿色。如何让它以绿色显示。它不会在成功时将 has-success 类添加到 form-group div 中。
这是HTML
<form role="form" method="post" class="form-horizontal" id="anyForm">
<div class="form-group required">
<label class="col-sm-4 col-xs-12 control-label">Meeting Days</label>
<div class="col-sm-6 col-xs-12">
<div class="row">
<div class="col-sm-6 col-xs-12">
<div class="checkbox">
<label><input type="checkbox" name="days[]" value="1">Monday</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="days[]" value="2">Tuesday</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="days[]" value="3">Wednesday</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="days[]" value="4">Thursday</label>
</div>
</div>
<div class="col-sm-6 col-xs-12">
<div class="checkbox">
<label><input type="checkbox" name="days[]" value="5">Friday</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="days[]" value="6">Saturday</label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="days[]" value="7">Sunday</label>
</div>
</div>
</div>
</div>
</div>
验证
$('#anyForm').formValidation({
framework: 'bootstrap',
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
"days[]" : {
validators: {
notEmpty: {
message: 'Required field'
}
}
}
}
});