Validation 如何验证隐藏字段
我使用的是bootstrapValidator插件,有一个隐藏字段,其值是动态设置的。当用户做出添加到隐藏字段的选择时,验证不会将其拾取 这是我试图验证的字段 定制车辆 HTML代码:Validation 如何验证隐藏字段,validation,Validation,我使用的是bootstrapValidator插件,有一个隐藏字段,其值是动态设置的。当用户做出添加到隐藏字段的选择时,验证不会将其拾取 这是我试图验证的字段 定制车辆 HTML代码: <div class="form-group"> <label class="" for="fname"></label> <input type="hidden" name="customerVehicles" class="customerVehicl
<div class="form-group">
<label class="" for="fname"></label>
<input type="hidden" name="customerVehicles" class="customerVehicles form-control" id="customerVehicles" />
</div><!-- close form group -->
我知道这很古老,但这对我来说很有用。排除选项看起来是一个状态数组。尝试:
excluded:[':disabled']
有人对此有什么想法吗?
$('#step2').bootstrapValidator({
message: 'This value is not valid',
live: 'enabled',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitHandler: function(validator, form, submitButton) {
document.getElementById("next2").disabled=true;
$.ajax({
type: "POST",
url: "scripts/process-step2.php",
data: $('#step2').serialize(),
success: function(msg){
...
},
error: function(){
alert("error");
}
});//close ajax
},
excluded: ':disabled',
fields: {
customerVehicles: {
message: 'Please Make a Selection',
validators: {
notEmpty: {
message: 'Please Make a Selection'
}
}
}// end dropdown
} // end field
});// bootstrapValidator