安全会议总结:表单名是二维数组变量,怎样才能用二维数组获得表单值

来源:百度文库 编辑:高校问答 时间:2024/04/27 22:27:43
<form name="form1" method="post" action="2.asp">
<table width="95%">
<%
for a=0 to 2
Response.Write "<tr>"
for b=0 to 2
%>
<td width="33%" height="40"><input name="x(<%=a&","&b%>)" type="text" id="x(a,b)"></td>
<%
next
Response.Write "</tr>"
next
%>
<tr>
<td width="33%" height="40"> </td>
<td width="33%" height="40"><input type="submit" name="Submit" value="提交"></td>
<td width="33%" height="40"> </td>
</tr>
</table>
</form>

name="x(<%=a&","&b%>)"

这你不管name=什么他都只是个字符串

你要把a和b的值传过去,然后用request对象获取
然后再循环付值给数组