Need to validate one field based on the value of other field using backbone validation js. How to approach this ? Is it possible to validate using lib methods like range validator, max validator OR should I go with custom method ??
Normally this is how it looks,
bindings: {
'value1': {
Observe: 'value1',
Setoptions:{
Validate:true
}
}
}
This will call validate method
Validation: {
Value1: {
Pattern: number,
Min: 0
/* here we need to validate value1 < value2 where value 2 is value of another input field */
}
}
Thanks
I don't see any thing that would fit to compare two values, see in built-in-validatiors
You can use
custom validator
if the usage is repetitive. Here usingvalidator method
You can use
named method validator
as well