Myeclipse软件中的jsp问题!
请教高手:::::::::::::::::::
用Myeclipse软件中的jsp,jsp中的<form>标签为什么不能给name属性?(给就会错)
如果我想在同页面的"脚本"中得到<form>中的值,应该怎样得到?
用dom来做
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'test.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function get()
{
var form = document.getElementById("myform");
alert(form.name);
}
</script>
</head>
<body>
<form id="myform" action="" method="POST" name="www.it.com.cn"></form> //但是我用name的时候没有出错啊
<button onClick="get()">Get</button>
</body>
</html>