【问题标题】:Submit button in <thead><thead> 中的提交按钮
【发布时间】:2015-05-10 13:33:44
【问题描述】:

&lt;thead&gt; 标签之间有一个输入提交按钮:

<form>
    <table>
        <thead>
          <th>TEXT</th>
          <td><input type="submit"></td>
        </thead>
        <tbody>
            ...
            input text fields
            ...
        </tbody>
    </table>
</form>

但是发布请求不包含输入文本字段的值。 如果我将提交按钮放入&lt;tbody&gt;,一切正常。

标签中不能使用提交按钮吗? 我需要将此按钮放在标题中,因为我的表格有一个固定的标题,我需要我的按钮始终可见。

【问题讨论】:

  • 引号在 引号内。
  • 可读性,插入 标签
  • 提交的位置不限,只要在&lt;form&gt;tags之间即可。我认为您是在表单标签中定义动作、方法和编码?您的参数是否具有name="" 属性?请提供完整代码,否则找不到故障。这是一个工作小提琴jsfiddle.net/q31mgm40

标签: html forms html-table submit


【解决方案1】:

你需要在&lt;table&gt;标签之前声明&lt;form action="file.php" method=""POST&gt;

<form action="file.php" method="POST">
  <table>
    <td>
    .
    .
    .
    </td>
  </table>
</form>

【讨论】:

    【解决方案2】:

    只需将表单声明为

    即可
     <form .... 
      <table>
        ....
      </table>
     </form>
    

    你可能在 tbody 中声明表单

    【讨论】:

      【解决方案3】:

      尝试像这样使用&lt;form&gt;标签:

      <form action="whatever.php" method="post">
      <table>
      <thead>
        <th>
          TEXT
        </th>
        <td>
          <input type="submit">
        </td>
      </thead>
      <tbody>
      ...
      input text fields
      ...
      </tbody>
      </table>
      

      【讨论】:

        【解决方案4】:

        尝试在 qoutes 中使用 qoutes。

        <table>
           <thead>
             <th>
              <form>
                 <input type="submit"/>
             </th>
           </thead>
          </form>
        </table>
        

        【讨论】:

        • 尝试使用,
          inside .**
        猜你喜欢
        • 2011-05-06
        • 1970-01-01
        • 2016-06-06
        • 1970-01-01
        • 1970-01-01
        • 2023-03-22
        • 1970-01-01
        • 2014-02-03
        • 2014-01-31
        相关资源
        最近更新 更多