【问题标题】:HTML form is not working with table inside [duplicate]HTML表单不适用于内部的表格[重复]
【发布时间】:2013-03-20 22:18:45
【问题描述】:

这里我把 table 放在 form 里面来排列表单项。
即使它有效,它也不起作用。

<form method="get" action="another.php">
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="60%">
        Number: <input type="text" name="number" />
    </td>
    <td width="20%" align="center">
        Title: <input type="text" name="title" />
    </td>
    <td width="20%">
        Short Desc: <input type="text" name="shortdesc" />
    </td>
</tr>
</table>
</form>

当我按 Enter 时,表单不会提交。
好像我在表单内的任何位置放置了一个提交按钮,它适用于 Enter 键和按钮单击。

<input type = "submit" value="Submit" />

但我不想要任何提交按钮。我按 Enter 键提交表单。
任何线索为什么这不起作用?

【问题讨论】:

标签: html html-table


【解决方案1】:

将此添加到您的表单中

<input type="submit" style="position: absolute; left: -9999px"/>

<input type="submit" style="visibility: hidden;"/>

【讨论】:

    【解决方案2】:

    添加这个......将为所有三个浏览器解决您的问题

     <input  type="submit" name="update" value=" Apply " 
    style="position: absolute; height: 0px; width: 0px; border: none; padding: 0px;"
    hidefocus="true" tabindex="-1"/>
    

    【讨论】:

      【解决方案3】:

      所有表单都需要一个提交按钮才能提交(至少没有 javascript):

      你可以让它不可见:

      <input type="submit" style="visibility:hidden"/>
      

      【讨论】:

        猜你喜欢
        • 2021-09-22
        • 2016-07-16
        • 2016-06-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-09-06
        • 2010-11-21
        • 1970-01-01
        相关资源
        最近更新 更多