0
我有與此處所述相同的問題:bootstrapvalidator gives "Cannot read property 'group' of undefined" on ckeditor field,但它與ckeditor無關。驗證碼就是從這裏取:http://formvalidation.io/validators/identical/ 這裏是我的jQuery代碼:bootstrapvalidator未捕獲TypeError:無法讀取未定義的屬性'group'
$('form').bootstrapValidator({
framework: 'bootstrap',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
password2: {
validators: {
stringLength: {
min: 6,
max: 10,
message: 'Field must be 6 to 10 characters long'
},
identical: {
field: 'password1',
message: 'The password and its confirm are not the same'
}
}
}
}
});
這裏是HTML:
<div class="form-group">
<label class="col-sm-2 control-label">Password</label>
<div class="col-sm-10">
<input type="password" name="password1" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Repeat password</label>
<div class="col-sm-10">
<input type="password" name="password2" class="form-control">
</div>
</div>
我在這裏完全疊加。請有人幫忙!