dpizd08264 2011-04-19 12:25
浏览 33
已采纳

使用zend decorator为zend表单创建一个错误的td

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.

  • 写回答

1条回答 默认 最新

  • douciwang6819 2011-04-19 13:10
    关注

    Please use the search button, there's already a solution

    Zend Form Decorators Error in Table

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c