关键的地方:
1.input type=checkbox 命名要一样,VALUE等于该记录的关键字,比如ID。
2.不同的提交BUTTON,使用不同的名字。
3.SQL中有一个IN关键字,很好用。
例子:
<form name=freezwy action=doit.asp method=post>
<input type=checkbox name=Vid value=<%=rs("id")%>><%'你要显示的%><br>
<input type=checkbox name=Vid value=<%=rs("id")%>><%'你要显示的%><br>
<input type=checkbox name=Vid value=<%=rs("id")%>><%'你要显示的%><br>
<input type=submit name=del value=del>
<input type=submit name=change value=change>
</form>
---------doit.asp---------
简单如下:
<%
vid=request.form("vid")
'这是一个集合
if vid="" or isnull(vid) then
response.write "no choice"
else
'处理不同的submit
if request.form("del")<>"" then
'处理del
sql="delete from table where id in ("&vid&")"
...........................
end if
if request.form("change")<>"" then
'处理change
end if
end if