When using Zend_Form only way to verify that the input is not left blank is to do
$element->setRequired(true);
If this is not set, and the element is empty, it seems to me that the check is not performed on the element.
If I use setRequired() , the element automatically gets the standard NotEmpty validator. The fact is that the error message with this validator sucks: "The value is empty, but a non-empty value is required." I want to change this message. At the moment, I have done this by changing the Zend_Validate_NotEmpty class, but this is a bit strange.
Ideally, I would like to be able to use my own class (derived from Zend_Validate_NotEmpty ) to perform non-empty checks.
source share