我正在使用 FormValidation,一个 jQuery 插件来验证我的表单。
如果我有这样的验证设置:
$form.formValidation({
framework: 'bootstrap',
excluded: ':disabled',
message: 'This value is not valid',
row: {
selector: 'div'
},
fields: {
'name': {
validators: {
notEmpty: {
message: 'Please enter your name'
}
}
}
}
在我的输入字段name
的每个输入中,验证都会触发。我希望仅在单击submit
按钮 ( which I have already done in my code
) 时触发验证,但是I am failing to disable the validation when entering a value into a input field
。
我怎样才能做到这一点?我需要更改或添加以上哪些设置?