how to decorate the error message
Posted
by ulduz114
on Stack Overflow
See other posts from Stack Overflow
or by ulduz114
Published on 2010-03-11T16:01:32Z
Indexed on
2010/03/12
17:47 UTC
Read the original article
Hit count: 246
this is the decorator code
$mydecorate = array(
'ViewHelper',
array('Errors', array('placement' => 'append','class' => 'error')),
array('Label', array('separator' => '')),
array('HtmlTag', array('tag' => 'p', 'class' => 'element-form'))
);
html result of two input elements with the above decorator:
<p class="element-form">
<label for="firstname" class="required">First Name:</label>
<input name="firstname" id="firstname" value="" type="text">
</p><ul class="error"><li>required field!</li></ul>
<p class="element-form">
<label for="lastname" class="required">Last Name:</label>
<input name="lastname" id="lastname" value="" type="text">
</p><ul class="error"><li>required field!</li></ul>
I'd like the error message to be placed inside the p.element-form tag, any idea pleas?
thanks
© Stack Overflow or respective owner