假设我在一个领域有这个验证:
之间: {
分钟:50,
最大:500,
message: '请输入正确的范围'
}
我想在运行min时更新max。我怎样才能做到这一点 ?
谢谢。
假设我在一个领域有这个验证:
之间: {
分钟:50,
最大:500,
message: '请输入正确的范围'
}
我想在运行min时更新max。我怎样才能做到这一点 ?
谢谢。
您可以使用该updateOption方法执行此操作。
请参阅以下代码:
$('#yourForm')
// Update min & max options
.formValidation('updateOption', 'yourInputName', 'between', 'min', 10)
.formValidation('updateOption', 'yourInputName', 'between', 'max', 90)
// Update message if you need to
.formValidation('updateOption', 'yourInputName', 'between', 'message', 'Your new message')
// You might need to revalidate field
.formValidation('revalidateField', 'yourInputName');
updateOption文档: http: //formvalidation.io/api/#update-option