`
folio
  • 浏览: 31186 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

关于“Invalid location of tag (form) ”错误或警告的解决

阅读更多
关于“Invalid location of tag (form) ”错误或警告的解决

Invalid location of tag (form) =无效的位置标记(form)

源代码如下,有错误提示!
<table width="100%" border="0" cellspacing="0" cellpadding="0">					
						<tr>
							<td width="37%" height="162">
								&nbsp;
							</td>
							<td width="40%">
								&nbsp;
							</td>
							<td width="23%">
								&nbsp;
							</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">
								&nbsp;
							</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">
								&nbsp;
							</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">
								&nbsp;
							</td>
							<td width="40%">
								&nbsp;
							</td>
							<td width="23%">
								&nbsp;
							</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">
								&nbsp;
							</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">
								&nbsp;
							</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提示正常了,原因在此:
<form></form>不能写到<table></table>里面!

2
1
分享到:
评论
1 楼 cxy_lucky 2012-05-30  
其实,即使是将form写在table之外,也会出这个错。

相关推荐

Global site tag (gtag.js) - Google Analytics