How to set the message of the NotEmpty validator on a Zend_Form_Element? <p>I have a form element that I'm setting as required:</p> <pre><code>$this-&gt;addElement('text', 'email', array( 'label' =&gt; 'Email address:', 'required' =&gt; true )); </code></pre> <p>Since I'm setting required to true, it makes sure that it's not empty. The default error message looks like this:</p> <pre><code>"Value is required and can't be empty" </code></pre> <p>I tried setting the message on the validator, but this throws a fatal error:</p> <pre><code>$validator = $this-&gt;getElement('email')-&gt;getValidator('NotEmpty'); $validator-&gt;setMessage('Please enter your email address.'); </code></pre> <blockquote> <p>Call to a member function setMessage() on a non-object</p> </blockquote> <p>How can I set the message to a custom error message?</p>