【发布时间】:2014-09-04 13:39:18
【问题描述】:
我想知道 BootstrapValidator http://bootstrapvalidator.com/ 是否有预输入验证。
我有一个表单,我在其中使用验证器验证我的字段。其中一个字段是 inout 字段,其中附加了预输入,因此输入字段由预输入选择填充。
但是每当我开始在输入字段中输入时,验证器都会验证它的真实性。我希望它必须仅在预先选择后验证,而不是通过在输入字段中写入来验证。
$(document).ready(function() {
var options = {};
options.common = {
minChar: 1
};
options.ui = {
showVerdictsInsideProgressBar : true,
viewports : {
progress : ".pwstrength_viewport_progress"
}
};
.......
$('#user_country').on('input', function() {
$(this).parent().find('.small').hide();
});
$('#user_reg_form').bootstrapValidator({
excluded: ':disabled',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
........
country: {
validators: {
notEmpty: {
message: 'city is required'
}
}
},
}
})
我的预输入看起来像
$(ele).typeahead({
select:function(){
// here i do the select.....
}
});
【问题讨论】:
标签: twitter-bootstrap-3 validation typeahead.js typeahead