I have the required element in my Zend Form:
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name')
->setValue(isset($plan)?$plan['name']:'')
->setRequired()
->setAttribs(array('class' => 'required', 'maxlength' => 50))
->addValidators(array(new Zend_Validate_StringLength(array('min' => 1, 'max' => 50)),
new Zend_Validate_Db_NoRecordExists(array('table' => 'plan', 'field' => 'name')))
->addFilters(array(new Zend_Filter_StringTrim, new Zend_Filter_StripTags));
All validators work perfect. But it is one problem. In controller I check form using getValidValues (it is required for me). And if Record in DB is exist, element is invalid and Zend clear this element. And I take the message 'Value is required'. How can I get message about existing of row in DB?
Sorry for my english. Thank you in advance.