需要使用主干验证js根据另一个字段的值来验证一个字段。如何解决这个问题?是否可以使用范围验证器、最大验证器等 lib 方法进行验证,或者我应该使用自定义方法吗?
正常情况下是这样的
bindings: {
'value1': {
Observe: 'value1',
Setoptions:{
Validate:true
}
}
}
这将调用验证方法
Validation: {
Value1: {
Pattern: number,
Min: 0
/* here we need to validate value1 < value2 where value 2 is value of another input field */
}
}
谢谢