主题:怎样在lest.asp中遍历取得<TD name=
怎样在lest.asp中遍历取得提交过来<TD name="T1">的数据?
index.asp 的代码如下:
----------------------------------
<script language="JavaScript">
<!--
function SubmitAndSetBlank(){
if( confirm('您确定进行下注吗?') ){
document.myForm.submit();
}
}
//-->
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页</title>
</head>
<body>
<form name="myform" method="POST" action="lest.asp?action=edit">
<table>
<tr>
<td id="T1" name="T1">12345</td>
<td id="">
<input type="submit" value="按钮" name="B1" onClick="SubmitAndSetBlank()"><input type="reset" value="重置" name="B2"></td>
</tr>
</table>
</form>
</body>
</html>
lest.asp 的代码如下:(为什么不行?)
--------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<%dim touzhu
action=request("action")
select case action
case "edit"
For Each Element In Request.Form
if InStr(Element,"T1")>0 then
touzhu=Request.Form(Element)(1)&","
end if
Next
response.write touzhu
end select%>
</body>
</html>
index.asp 的代码如下:
----------------------------------
<script language="JavaScript">
<!--
function SubmitAndSetBlank(){
if( confirm('您确定进行下注吗?') ){
document.myForm.submit();
}
}
//-->
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页</title>
</head>
<body>
<form name="myform" method="POST" action="lest.asp?action=edit">
<table>
<tr>
<td id="T1" name="T1">12345</td>
<td id="">
<input type="submit" value="按钮" name="B1" onClick="SubmitAndSetBlank()"><input type="reset" value="重置" name="B2"></td>
</tr>
</table>
</form>
</body>
</html>
lest.asp 的代码如下:(为什么不行?)
--------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<%dim touzhu
action=request("action")
select case action
case "edit"
For Each Element In Request.Form
if InStr(Element,"T1")>0 then
touzhu=Request.Form(Element)(1)&","
end if
Next
response.write touzhu
end select%>
</body>
</html>