how to check if the enddate is after the startdate in a zend form
Posted
by murze
on Stack Overflow
See other posts from Stack Overflow
or by murze
Published on 2010-04-16T13:59:46Z
Indexed on
2010/04/16
14:03 UTC
Read the original article
Hit count: 387
I have a zend form with a start- and an endate.
$form = new Zend_Form();
$form->setName($this->formName)
->setMethod('post');
$feStartdate = new Zend_Form_Element_Text('startdate');
$feEnddate = new Zend_Form_Element_Text('enddate');
$form->addElement($feStartDate)
->addElement($feEndDate)
->addElement('submit', 'submit', array('label' => 'Save'));
I assume I must write a custom validator for to check this. How would this custom validator look like and how can I call it? I assume something like
$feEnddate->addValidator('dateComesAfter', $feStartDate)
© Stack Overflow or respective owner