主题:  复选框数据提交到一个字段,再分段提取的具体方法

summerqz

职务:普通成员
等级:1
金币:0.0
发贴:12
#12005/8/25 10:28:13
下面是有复选框的主页代码我怎么加进去啊
<%@LANGUAGE="javascript"%>
<!--#include file="Connections/wy.asp" -->
<%
var zb = Server.CreateObject("ADODB.Recordset";
zb.ActiveConnection = MM_wy_STRING;
zb.Source = "SELECT * FROM dbo.zb";
zb.CursorType = 0;
zb.CursorLocation = 2;
zb.LockType = 1;
zb.Open();
var zb_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
zb_numRows += Repeat1__numRows;
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="includes/echoice_bbs.css">
</head>
<SCRIPT language=javascript>
function SetChecked(val) {
dml=document.form1;
len = dml.elements.length;
var i=0;
for( i=0 ; i<len ; i++) {
if (dml.elements.name=='del') {
dml.elements.checked=val;
}
}
}
</SCRIPT>
<body bgcolor="#dbdbdb">
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<form method="post" action="print.asp" name="form1" >

<table width="100%" border="0" cellspacing="1" cellpadding="2" align="center">
<tr bgcolor="#666699">
<td bgcolor="#666699" width="6%"><div align="center"><font color="#FFFF00">显示</font></div> </td>
<td bgcolor="#666699" width="14%"><div align="center">地址</div></td>
<td width="18%">&nbsp;</td>
<td width="32%">
<div align="center"><font color="#FFFF00">题目</font></div>
</td>
<td width="13%" bgcolor="#666699">
<div align="center"><font color="#FFFF00">发送者</font></div>
</td>
<td width="17%">
<div align="center"><font color="#FFFF00">发送日期</font></div>
</td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!zb.EOF)) { %>
<tr bgcolor="#f7f7f7">
<td>
<div align="center">
<input <%=(((zb.Fields.Item("z_id".value) == "checkbox"?"checked":""%> name="del" type="checkbox" id="del" value="checkbox">
</div></td>
<td><%=(zb.Fields.Item("address".value)%></td>
<td bgcolor="#f7f7f7">&nbsp;</td>
<td bgcolor="#f7f7f7"><div align="center"><%=(zb.Fields.Item("fwneirong".value)%></div></td>
<td>
<div align="center"></div></td>
<td align="center"><%=(zb.Fields.Item("bxtime".value)%></td>
</tr>
<%
Repeat1__index++;
zb.MoveNext();
}
%>

</table>
<p align="right">
<input type="submit" name="Submit" value="显示所选的" class="buttonface">
<input type=button value="选择所有" onClick="SetChecked(1)" name="button" class="buttonface">
<input type=button value="取消所有" onClick="SetChecked(0)" name="button2" class="buttonface">
</p>
</form>
</td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div align="CENTER">
<p>&nbsp;</p>
</div>
<p>&nbsp;</p>
</body>
</html>
<%
zb.Close();
%>

谢谢了