I am having two problems with Zend Form and Zend Decorators that are driving me crazy.
I am trying to get this html structure when I get a form error:
<li class="error"><label class="desc" for="name"> First Name </label>
<div>
<input class="field text half" name="name" type="text" value="" />
</div>
<p class="hint"> Your nickname </p>
<p class="error"> Error Message </p>
</li>
- I want to replace the <ul> and <li> elements of the error messages with a <p> element. And then to have it print out an error message at the bottom of the <li>.
- I want to add the class "error" to the <li> when it returns an error. I imagine the code will look something like the code below, but I can't figure it out.
if( $form->isValid($formData) ) {
...
} else {
$this->view->message = 'Validation Failed.';
$form->setElementDecorators(...);
}
Thanks so much for any help,
Daniel