$this->addElement('text', 'projected-start', array(
'required' => false,
'validators' => array (
array('date', false, array('MM/dd/yyyy'))
),
'label' => 'Projected Start:',
'class' => 'form-date'
));
I'm extending Zend_Form to create a new custom form. I tried to validate a date using the code above but it simply is not working and nothing is displaying when I enter an invalid input. Any help on this one?
EDIT:
class Application_Form_CreateProject extends Zend_Form
{
public function init()
{ ... }
}
Thats the start of extending the form.
$form = new Application_Form_CreateProject();
$request = $this->getRequest();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
echo "true";
}
}
$this->view->form = $form;
That's the controller
echo $this->form->setAction($this->url());
That's the view