I have created a zend form with decorator. I have used validators. So, when error occur then I want to generate this code:
<form enctype="application/x-www-form-urlencoded" action="add" method="post" Name="addfrm" class="textpos" Id="addfrm" name="">
<table align="center" class="tbcss" width="84%">
<tr>
<td align="right" valign="top" width="15%"><label for="cou_name" class="required">Country Name :</label></td>
<td class="element" width="100%" valign="top">
<input type="text" name="cou_name" id="cou_name" value="" size="39" />
<img class="imgpos" src="/zendf/public/images/help.gif"></img>
</td>
<td>
<ul class="errors">
<li>Country name is required.</li>
<li>Please Enter character data in country name.</li>
</ul>
</td>
</tr>
</table>
</form>
but actually code is generating like this:
<form enctype="application/x-www-form-urlencoded" action="add" method="post" Name="addfrm" class="textpos" Id="addfrm" name="">
<table align="center" class="tbcss" width="84%">
<tr>
<td align="right" valign="top" width="15%"><label for="cou_name" class="required">Country Name :</label></td>
<td class="element" width="100%" valign="top">
<input type="text" name="cou_name" id="cou_name" value="" size="39" />
<ul class="errors">
<li>Country name is required.</li>
<li>Please Enter character data in country name.</li>
</ul>
<img class="imgpos" src="/zendf/public/images/help.gif"></img>
</td>
</tr>
</table>
</form>
I am using this decorator:
public $textbox = array( 'ViewHelper',
array('Errors'),
array(array('image' => 'HtmlTag'), array('tag' => 'img', 'placement' => 'append','class'=>'imgpos','src'=>'/zendf/public/images/help.gif')),
array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element','width'=>'100%','valign'=>'top')),
array(array('closeLabel' => 'HtmlTag'),array('tag' => 'td', 'closeOnly' =>
true, 'placement' => 'prepend')),
'Label',
array(array('openLabel' => 'HtmlTag'),array('tag' => 'td', 'openOnly' => true,'align'=>'right','valign'=>'top','width'=>'15%')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr')), );
I want that when error occur then it will create a td and display in it.
can anyone help me plz.