在单个表中包含多个表单的正确方法

Ian*_*ber 1 html

是否有正确的方法在单个表中包含多个表单?

例如,我有8行,其中四行对应一个表,另外四行对应一秒.最好的方法是什么?我知道在TR之间放一张表是无效的.

小智 5

我想我找到了解决问题的方法,因为我发现自己处于同样的境地.这是我所做的一个例子.

<form id="uno" name="uno" action="somescript.php" method="post">
<input type="hidden" id="myhidden" value="1">
</form>
<form id="dos" name="dos" action="anotherscript.php" method="post">
<input type="hidden" id="myhidden" value="2">
</form>

<table id="uniqueTable">
<tr>
<td><input form="uno" type="text" id="x_value" name="x_value" value="0.00"></td>
<td><input form="dos" type="text" id="x_anothervalue" name="x_anothervalue" value="0.00"></td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)

通过这种方式,虽然只有一个表,但您的每个输入都属于表中所述的表格 form="formName"

希望它可以帮助某人 - 阿纳金

  • 谁使用IE呢?:P (2认同)