- 爱易网页
-
ASP教程
- FOR EACH name IN Request.Form("rc") 有关问题 解决就给分
日期:2014-05-17 浏览次数:21029 次
FOR EACH name IN Request.Form("rc") 问题 解决就给分
我的代码 如下:
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 无标题文档 </title>
</head>
<body >
<form name= "form1 " method= "post " action= " ">
<table width= "200 " border= "1 ">
<tr>
<td> <label>
<input type= "checkbox " name= "rc " value= "checkbox ">
</label> </td>
<td> </td>
</tr>
<tr>
<td> <label>
<input type= "checkbox " name= "rc " value= "checkbox ">
</label> </td>
<td> </td>
</tr>
<tr>
<td> <label>
<input type= "checkbox " name= "rc " value= "checkbox ">
</label> </td>
<td> </td>
</tr>
<tr>
<td> <%
dim aa
aa=0
FOR EACH name IN Request.Form( "rc ")
aa=aa+1
NEXT
IF aa> 3 THEN
Response.write " <Script language=JavaScript> alert( '你选择太多了! ') </Script> ; "
%> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
我想解决的问题 如下:
我想通过
dim aa
aa=0
FOR EACH name IN Request.Form( "rc ")
aa=aa+1
NEXT
IF aa> 3 THEN
Response.write " <Script language=JavaScript> alert( '你选择太多了! ') </Script> ; "
这个语句 把 "已经 "选中的复选框 通过循环读出的个数 如果大于3个就提示错误