-- Xavier Vidal Piera <[EMAIL PROTECTED]> wrote
(on Monday, 28 April 2008, 10:20 AM +0200):
> At the moment, is there any method or proposal to test values between
> Form_Elements (like the "equals" between passwords)?.

You can use the $context parameter to a validator's isValid() method,
which is documented on the following page, under the heading "Validation
Context":

    
http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.validators

It will require building a custom validator, however.

The other possibility is to do as you suggest, and create a composite
element. Probably the best way to do so is to make sure the element is
returned as an array by the form, and then your validator can look at
the various array elements:

    <input type="password" name="password[requested]" ... />
    ...
    <input type="password" name="password[verification]" ... />

This will still require a custom validator, but would not require
utilizing validation context, as described earlier.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to