I have model (List) which have a list of values: 5 10 20 30 40 50
I have a input value where i must to insert a minimal value which is the previous value insert. if i insert 7 the next minimal value should be 10. if i insert 11 the next minimal value is 20.
My question is how can validate this input? in model i have:
'valor_licitacao' => array(
'required' => array(
'rule' => array('comparison', '>=', 20000),
'message' => 'The value must be greater then 20000'
)
)
how can i define a rule that says: "the values should be greater than List->find('first', 'conditions' => array('List.valor > '.$mylastvalue)));
Thanks in advance, please feel free to ask any question about this.
You will want to create a custom validation method. This method can look as the input field and if it is greater than the lower band, you can set it to the value you want.