| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 573 人关注过本帖
标题:求1列表选择的结果是2列表的查询条件 源码
只看楼主 加入收藏
cfsm
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-6-21
收藏
 问题点数:0 回复次数:4 
求1列表选择的结果是2列表的查询条件 源码
求1列表选择的结果是2列表的查询条件 源码
谢谢各位高手
搜索更多相关主题的帖子: 源码 列表 条件 结果 查询 
2007-06-21 10:22
guyer
Rank: 2
等 级:新手上路
威 望:5
帖 子:451
专家分:0
注 册:2007-1-19
收藏
得分:0 

<%
if session("admin")="" then
response.Redirect("login.asp")
end if
%>
<!--#include file="conn.inc"-->
<%
sql="select * from p_class"
set rs=conn.execute(sql)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>经峰网络科技有限公司-系统集成-网络工程-综合布线</title>
<link href="text.css" rel="stylesheet" type="text/css">
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%=rs("c_types")%>","<%=rs("c_name")%>","<%=rs("id")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;

function changelocation(locationid)
{

document.form1.ctypes.length = 0;
//window.alert(locationid);
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.ctypes.options[document.form1.ctypes.length] = new Option(subcat[i][0], subcat[i][0]);
//window.alert("aa");
}
}

}

</script>

<script language="javascript">
function checkForm(str){
if(document.all.classid.value=="0"){
alert('请选择一级类别');

return false;
}
if(document.all.title.value==""){
alert('产品名称不能为空');

return false;
}

}
</script>
<style type="text/css">
<!--
body {
background-color: #F3F3F3;
}
.style8 {color: #CCCCCC}
.style9 {color: #aa0000}
-->
</style></head>

<body>
<table width="58%" height="293" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="aa0000">
<tr>
<td align="left" valign="top" bgcolor="#CCCCCC"><table width="100%" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="bb0000">
<tr>
<td><div align="center" class="style8">添加产品信息</div></td>
</tr>
</table>
<form name="form1" method="post" onsubmit="return checkForm();" action="add.asp?cz=8">
<div align="center">
<p align="left">
选择类别:
<select name="classid" id="classid" onChange="changelocation(document.form1.classid.options[document.form1.classid.selectedIndex].value)">
<option value="0" selected>↓==一级类别==↓</option>
<% sql="select * from p_class where l_id=1"
set rs1=conn.Execute (sql) %>
<%dim cj
do while not rs1.EOF
id=rs1("id")
c_name=rs1("c_name")
response.Write("<option value="&id&">"&c_name&"</option>")
%>
<%
rs1.MoveNext
loop
rs1.close
set rs1=nothing
%>
</select>
 
<select name="ctypes" id="ctypes" >
<option value="0" selected>↓==二级类别==↓</option>
</select>

 
推荐
<input name="tj" type="checkbox" id="tj" value="1">
<br>
<br>
产品名称:
<input name="title" type="text" id="title"> 
发布时间:
<input type="text" name="sdate" readonly value="<% response.Write(now()) %>">
</p>
<p align="left">型  号:
<input name="xh" type="text" id="xh"> 
录 入 人:
<input name="lrr" type="text" readonly value="<%=session("admin")%>">
<br>
<br>
价  格:
<input name="jg" type="text" id="jg"> 
产品图片:
<input type="text" name="photo" id="photo" >
<input type="button" name="Submit" value="上传图片" onClick="window.open('scpybinbin.asp?formname=form1&editname=photo&uppath=images/upfile&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">
<br>
<br>
产品简介:<br>     
<textarea name="jj" cols="60" rows="6" id="jj"></textarea>
<br>
<br>
详细介绍:
<IFRAME ID="eWebEditor1" SRC="et/ewebeditor.asp?id=content1&style=full_v100" FRAMEBORDER="0" SCROLLING="no" WIDTH="630" HEIGHT="450">
</IFRAME>
</p>
<div align="center">
<input type="submit" name="Submit" value="提交">
   
<input type="reset" name="Submit" value="重置">
</div>
<textarea name="content1" id="content1" style="display:none"></textarea><br>
</p>
</div>
</form></td>
</tr>
</table>
</body>
</html>

不知道你是不是要这个???


http://www./
2007-06-21 10:29
shdyh977
Rank: 1
等 级:新手上路
威 望:1
帖 子:109
专家分:0
注 册:2007-5-22
收藏
得分:0 
写具体详细些,最好把字段列出来
2007-06-21 10:30
cfsm
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-6-21
收藏
得分:0 

if session("dj")="1" then
%>
<!--webbot bot="Validation" s-display-name="栏目分类" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="lm">
<option>请选择</option>
<%
sql = "select * from lm where lm<>'' order by id asc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
while not rs.eof
%>
<option value='<%=rs("id")%>|0|0' <% if clng(lmid)=clng(rs("id")) then response.write " selected" %>><%=rs("lm")%>(1级)</option>
<% sql2 = "select * from lm where lmid='"&rs("id")&"' order by id asc"
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
while not rs2.eof
%>
<option value='<%=rs("id")%>|<%=rs2("id")%>|0' <% if clng(lmid)=clng(rs2("id")) then response.write " selected" %>> ├<%=rs2("lm2")%>(2级)</option>
<%
Set rs33 = Server.CreateObject("ADODB.RecordSet")
rs33.Open "select * from [lm] where lm3<>'' and lmid='"&rs2("id")&"' order by id asc",conn,1,1
while not rs33.eof
%>
<option value='<%=rs2("lmid")%>|<%=rs2("id")%>|<%=rs33("id")%>' <% if clng(lmid)=clng(rs33("id")) then response.write " selected" %>>  ├<%=rs33("lm3")%>(3级)</option>
<%
rs33.movenext
wend
rs2.movenext
wend
rs.movenext
wend
rs.close
set rs=nothing

%>

</select>
<%else%>&nbsp;<!--webbot bot="Validation" s-display-name="栏目分类" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select name="lm1" size="1" id="lm1">
<option>请选择</option>
<option value="<%=lm_1_rs("lmid")%>|<%=lm_1_rs("id")%>|0">├ &lt;%=lm_1_rs(&quot;lm2&quot;)%&gt;(2级)</option>
<option value="<%=lmid31%>|<%=lm_1_rs("lmid")%>|<%=lm_1_rs("id")%>">├ &lt;%=lm_1_rs(&quot;lm3&quot;)%&gt;(3级)</option>
<%
admin_sql = "select * from admin where [user]='"&adminuser&"' order by id desc"
Set admin_rs = Server.CreateObject("ADODB.RecordSet")
admin_rs.Open admin_sql,conn,1,1
admin_lmid=admin_rs("lmid")
for kkk=1 to 31
admin_lmid=replace(admin_lmid,chr(i),"")
next
'Response.Write admin_lmid

array_admin_lmid=split(admin_lmid,",")
For i=0 to ubound(array_admin_lmid)
aaa=array_admin_lmid(i) '取出编辑者拥有的权限ID号.
if aaa="" then aaa=0
lm_1_sql = "select * from lm where id="&aaa
Set lm_1_rs = Server.CreateObject("ADODB.RecordSet")
lm_1_rs.Open lm_1_sql,conn,1,1

while not lm_1_rs.eof
if lm_1_rs("lm")<>"" then
%>
<%
ElseIf lm_1_rs("lm2")<>"" then
%>
<%

Elseif lm_1_rs("lm3")<>"" then
get_1_id_sql="select lmid from [lm] where id="&clng(lm_1_rs("lmid"))
set get_1_id_rs = Server.CreateObject("ADODB.RecordSet")
get_1_id_rs.Open get_1_id_sql,conn,1,1
lmid31=get_1_id_rs("lmid")
get_1_id_rs.close
set get_1_id_rs=nothing
%>
<%
end if '结尾配对lm_1_rs("lm")<>""


lm_1_rs.movenext
wend
lm_1_rs.close
set lm_1_rs=nothing
next
admin_rs.close
set admin_rs=nothing

%>

</select>

<%end if%>
这是我的程序 头头 要让我改成 2级联动的 求各位高手给改下

2007-06-21 11:12
guyer
Rank: 2
等 级:新手上路
威 望:5
帖 子:451
专家分:0
注 册:2007-1-19
收藏
得分:0 
fEf1DFc0.rar (37.02 KB) 求1列表选择的结果是2列表的查询条件 源码

这个是我的 不知道适合你不.

http://www./
2007-06-21 15:41
快速回复:求1列表选择的结果是2列表的查询条件 源码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036578 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved