I tried to you your script, but you missing 'return' - should be:
public function isValid($value)
{
if (array_key_exists('contactBy', $value) && $value['contactBy'] ==
'email') {
$this->emailAddress->setRequired(true);
}
*return* parent::isValid($value);
}
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-Form-Setting-element-required-based-on-a-condition-tp640447p4306313.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]