【发布时间】:2012-03-15 01:14:14
【问题描述】:
在 HTML 页面中将表单的每个元素都包裹在 <form> 标记中会不会是错误的?很好奇为什么会出错:
基本上我必须介绍两种形式(form1 和 form2),其中一些元素与第一种相关联,而另一些与第二种相关联。布局必须完全基于表格,因为两种形式的元素都是整个页面都是我写的(根据http://validator.w3.org/check,代码有效):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<table border="1">
<tr>
<td>
<form name="form1" method="POST" action="via.php">
Enter the first form text here!: <input type="text" name="first"/>
</form>
</td>
<td rowspan="2">
<form name="form2" method="POST" action="via.php">
Enter the second form text here!:<input type="text" name="second"/>
</form>
<form name="form1" method="POST" action="via.php">
Enter the first form text here!:<input type="text" name="first"/>
</form>
</td>
</tr>
<tr>
<td>
<form name="form1" method="POST" action="via.php">
<input type="submit" name="form1submit" value="submit1"/>
</form>
<form name="form12" method="POST" action="via.php">
<input type="submit" name="form2submit" value="submit2"/>
</form>
</td>
</tr>
</table>
【问题讨论】:
标签: html forms html-table tablelayout