不同名的多选框怎么读取和添加

stillwell333 2010-11-04 12:28:18
字段 字段 字段 字段

<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="cp.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>


<body >

<form name="formct" method="post" action="">

<table width="800" height="56" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#799AE1">
<tr bgcolor="#ECF5FF">

<td width="80" bgcolor="#000099" class="tbhead">Product No.</td>

<td width="100" bgcolor="#000099" class="tbhead">CDorcellmembranemolecules</td>

<td width="100" bgcolor="#000099" class="tbhead">Chromatinandtranscription</td>

<td width="100" bgcolor="#000099" class="tbhead">Complementproteins</td>

<td width="100" bgcolor="#000099" class="tbhead">asdasd</td>

</tr>

<tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor = '#cccccc';" onMouseOut="this.style.backgroundColor = 'white';">

<td width="80">010105E10H</td>

<td width="100">
<input type="checkbox" name="CDorcellmembranemolecules" value="0"></td>


<td width="100">
<input type="checkbox" name="Chromatinandtranscription" value="0"></td>


<td width="100">
<input type="checkbox" name="Complementproteins" value="0"></td>


<td width="100">
<input type="checkbox" name="asdasd" value="0"></td>


</tr>

</table>

<input type="submit" name="Submit2" value="提交">
<input name="addct" type="hidden" id="addct" value="ok">
</form>

</body>
</html>

...全文
33 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
街头小贩 2010-11-04
  • 打赏
  • 举报
回复
读取按名称读取就可以了
街头小贩 2010-11-04
  • 打赏
  • 举报
回复
你想怎么添加
stillwell333 2010-11-04
  • 打赏
  • 举报
回复
<!-- #include file="is_admin.asp" -->
<!-- #include file="conn.asp" -->
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="cp.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<%
'set rsc=server.CreateObject("adodb.recordset")
'sqlc = "select * from chanpin where id ="&request("id")
'rsc.open sqlc,conn,1,1
'if request("add")="ok" then
'set rs=server.CreateObject("adodb.recordset")
'sql = "select * from chanpinduitype"
'rs.open sql,conn,3,3
'rs.addnew
' rs("typeid")=request.Form("fenlei")
' rs("chanpinid")=request("id")
'rs.update
' call Confirm("添加成功,是否继续添加!","chanpinfenlei.asp?id="&request("id")&"","chanpin.asp")

'end if
%>

<body >
<%

'end if
%>
<form name="formct" method="post" action="">
<%
set rsct=server.CreateObject("adodb.recordset")
sqlct = "select * from ct where ProductNo = '"&request("t")&"'"
rsct.open sqlct,conn,1,1
ct=rsct.fields.count-1
%>
<table width="800" height="56" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#799AE1">
<tr bgcolor="#ECF5FF">

<td width="80" bgcolor="#000099" class="tbhead">Product No.</td>
<%
'读取表的字段名称以作为表格的标题
FOR I=2 To ct
cnum=rsct(I).Name


%>
<td width="100" bgcolor="#000099" class="tbhead"><%=rsct(I).Name%></td>
<%next%>
</tr>
<%'do while not rsct.eof
if request("addct")="ok" then
set rs=server.CreateObject("adodb.recordset")
sql = "select * from ct where ProductNo = '"&request("t")&"'"
rs.open sql,conn,3,3
end if
%>
<tr bgcolor="#FFFFFF" onMouseOver="this.style.backgroundColor = '#cccccc';" onMouseOut="this.style.backgroundColor = 'white';">

<td width="80"><%=request("t")%></td>
<%For I=2 To ct
thisvalue=rsct(I)
if isnull(thisvalue) then
thisvalue= " "
'如果字段为空,则将变量 thisvalue的值定义为一个空格
end if

%>
<td width="100">
<input type="checkbox" name="<%=rsct(I).Name%>" value="<%=thisvalue%>"></td>

<%next%>
</tr>
<%'rsct.movenext
'loop%>
</table>
<%
rsct.close
Set rsct=Nothing
Conn.Close
Set Conn=Nothing

%>
<input type="submit" name="Submit2" value="提交">
<input name="addct" type="hidden" id="addct" value="ok">
</form>

</body>
</html>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧