title: How does one apply a class to a Zend Framework decorator on error?
body: <p>Right now, I have Zend form elements wrapped in list-items. Form is validating or coughing up errors as it should. But I'd like to apply a class to the list-items of offending elements (but <em>only</em> to the list-items offending elements) on failed validation. Example:</p>
  
  <p>This field has valid input</p>
  
  <pre><code>&lt;li&gt;
      &lt;input type="text" name="address2" id="address2" value="" size="25"&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>but this one does not</p>
  
  <pre><code>&lt;li class="error"&gt;
      &lt;input type="text" name="address2" id="address2" value="" size="25"&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>The only way I can see to do this is to extend Zend_Form_Element, and override isValid() and then extend all classes derived from Zend_Form_Element I need for my form(s).</p>
  
  <p>There has got to be a better way.</p>
  
  <p>Right?</p>
  
  <p>What am I missing?</p>
  
  <p>THANKS</p>