据我了解,jqBootstrapValidation 应该自动验证 html5 元素,如下所示:
<input type="number" class="form-control" name="ordPrice" placeholder="Price" data-validation-number-message="Not a number">
但是,事实并非如此。这是我的js绑定:
$('#create_form').find('input,select,textarea').not('[†ype="submit"], [type="file"]').jqBootstrapValidation({
preventSubmit: true,
submitError: function($form, event, errors) {
console.log('error!');
},
submitSuccess: function($form, event) {
console.log('success!');
event.preventDefault();
},
filter: function() {
return $(this).is(':visible');
}
});
我在这里错过了一些非常基本的东西吗?