this line always return true even if username input is empty
if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
my form username input looks like this
<?php
$this->addElement(new Zend_Form_Element_Text('username'));
$this->addElement('text','username',
array('class' => 'input-large',
'value' => $this->user_login,
'attribs' => array('disabled' => 'disabled') /// it can be activated by button in view
));
$username = new Zend_Form_Element_Text('username');
$username->addValidator ( new Zend_Validate_NotEmpty() );
?>
but something like this works
$validator = new Zend_Validate_NotEmpty();
$data = $_POST['username'];
if($validator->isValid($data)) {
echo 'sweet';
}else {
echo 'bad';
}