关于“Invalid location of tag (form) ”错误或警告的解决
Invalid location of tag (form) =无效的位置标记(form)
源代码如下,有错误提示!
修改为:
MyEclipse提示正常了,原因在此:
[color=red]<form></form>不能写到<table></table>里面![/color]
Invalid location of tag (form) =无效的位置标记(form)
源代码如下,有错误提示!
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="37%" height="162">
</td>
<td width="40%">
</td>
<td width="23%">
</td>
</tr>
<form name="MainForm" method="POST" action="loading.jsp">
<tr>
<td height="39" align="right" class="denglv01">
姓名:
</td>
<td height="39" align="right">
<input name="p_User_Id" type="text" size="20" class="box04"
tabindex="1">
</td>
<td height="39">
</td>
</tr>
<tr>
<td height="39" align="right" class="denglv01">
密码:
</td>
<td height="39" align="right">
<input name="p_User_Pwd" type="password" size="21" class="box04">
</td>
<td height="39">
</td>
</tr>
</form>
<tr>
<td height="49" colspan="3">
<a href="#" onClick="document.MainForm.submit()"><img
src="images_xf/botton3.jpg" width="62" height="21" border="0">
</a>
<a href="#"><img src="images_xf/botton4.jpg" width="62"
height="21" border="0">
</a>
</td>
</tr>
</table>
修改为:
<form name="MainForm" method="POST" action="loading.jsp">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="37%" height="162">
</td>
<td width="40%">
</td>
<td width="23%">
</td>
</tr>
<tr>
<td height="39" align="right" class="denglv01">
姓名:
</td>
<td height="39" align="right">
<input name="p_User_Id" type="text" size="20" class="box04"
tabindex="1">
</td>
<td height="39">
</td>
</tr>
<tr>
<td height="39" align="right" class="denglv01">
密码:
</td>
<td height="39" align="right">
<input name="p_User_Pwd" type="password" size="21" class="box04">
</td>
<td height="39">
</td>
</tr>
<tr>
<td height="49" colspan="3">
<a href="#" onClick="document.MainForm.submit()"><img
src="images_xf/botton3.jpg" width="62" height="21" border="0">
</a>
<a href="#"><img src="images_xf/botton4.jpg" width="62"
height="21" border="0">
</a>
</td>
</tr>
</table>
</form>
MyEclipse提示正常了,原因在此:
[color=red]<form></form>不能写到<table></table>里面![/color]
本文解决了HTML中表单(form)标签放置在表格(table)标签内的错误,导致MyEclipse等IDE报错的问题。通过调整表单标签的位置,确保其位于表格标签之外,可以消除错误并使代码符合规范。
1万+

被折叠的 条评论
为什么被折叠?



