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 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教