【问题标题】:Add Form In Every Row with table helper Codeigniter使用表格助手 Codeigniter 在每一行中添加表单
【发布时间】:2012-12-15 04:31:24
【问题描述】:

您好,我正在使用表格助手创建表格,但在每一行中我想添加表单,在 html 中如下所示:

<table>
  <form action="">
  <tr>
    <td><input type="text" name="name2"></td>
  </tr>
  </form>

  <form action="">
  <tr>
    <td><input type="text" name="name2"></td>
  </tr>
  </form>
</table>

但我想在表格助手中: 这个我试过了:

    $this->table->add_row(
                form_open('myAction').
                form_input('name'.$i),
                form_submit('Submit')
                form_close()
        );

我使用 firebugs 来检查元素生成,如下所示:

   <table>
     <tr>
       <form action="myAction">
         <td><input type="text" name="name1"></td>
       </form>
          <td><input type="submit"></td>
      </tr>
  </table>

为什么标签不显示在最后一个标签,而是显示在第一个标签。

谢谢

【问题讨论】:

    标签: php codeigniter


    【解决方案1】:

    你错过了一些点

    $this->table->add_row(
                form_open('myAction').
                form_input('name'.$i).
                form_submit('Submit').
                form_close()
        );
    

    【讨论】:

      猜你喜欢
      • 2013-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多