Well, if you use Zend_Filter_Input, you won't have access to the famous
$context variable. On the other hand, you will be able to retrieve the value
of several fields using the 'fields' metacommand. But this last strategy is
compromised by the fact that all validators will be provided with those
fields, so you cannot combine for example a StringLength validator and and
StringEquals validator, as the first one will receive an array (of fields
value) instead of a string (the field value).

  Stéphane


iceangel89 wrote:
> 
> 
> lightflowmark wrote:
>> 
>> The isValid function also takes an optional 'context' parameter which is
>> an array of all the values submitted.
>> public function isValid($value, $context = null)
>> {
>> if(($context['box1'] + $context['box2'] + $context['box3']) > $someValue)
>> {
>>    // error
>> }
>> }
>> 
> 
> for this purpose is it better to use a filter or this way. 
> 
> say i attach a filter to the balance input box. then the filter will take
> the values of all other inputboxes and return the sum. is a filter meant
> to do this? to validate, i take the filtered value to validate?
> 
> then i will need to pass the form to the filter 1st? or add a $context to
> the filter method but thats not supported. 
> 

-- 
View this message in context: 
http://www.nabble.com/Validating-based-on-more-than-1-inputs-tp23354455p25252590.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to