Hi,

1)  ISO dates can be compared as strings, that's one of the main point of
the formats - 2009-06-30 > 2009-05-01.  You should use a filter to convert
your dates to this format anyway

2) You need to write a custom validator to compare 2 fields in a form; it's
very easy, see the example on
http://framework.zend.com/manual/en/zend.form.elements.html (1/3 of the way
down, "Validation Context"

Yours,
Mark








asgeo1 wrote:
> 
> Hi,
> 
> I'm new to learning the Zend Framework, and are having trouble
> understanding how one would use the greaterThan validator to check that a
> Zend_Form_Element_Date element is greater than another
> Zend_Form_Element_Date in the same form.
> 
> First I find that greaterThan doesn't know how to compare dates and is
> actually just comparing strings which is lame.
> 
> Secondly, with these validators, there does not appear to be anyway to
> make them compare the value of a form element to the value of another form
> element.
> 
> Other than to subclass Zend_Validate_GreaterThan and add my own support
> for this, I can't see anyway to get around this.
> 
> I hope someone tells me I'm just doing this all wrong.
> 
> Thanks,
> -adam
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-validator-%28greaterThan%29-to-refer-to-another-element-in-form-tp24266813p24267692.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to