全民k歌怎么改家族名字:asp 高手进来看看!

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 04:50:04
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from sort2 order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>

onecount=<%=count%>;

function changelocation(locationid)
{
document.myform.Nclassid.length = 0;

var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}

}
</script>
<body>
<table>
<tr>
<td>
<table>
<form name="myform" method="post" action="saveaddbook.asp?action=add" OnSubmit="return checkkk()">
<tr>
<td width="8%"> </td>
<td width="13%">选择分类</td>
<td colspan="2">
<%
rs.open "select * from sort order by anclassidorder",conn,1,1
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%>
大类<select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
<option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
<%
dim selclass
selclass=rs("anclassid")
rs.movenext
do while not rs.eof
%>
<option value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
<%
rs.movenext
loop
end if
rs.close
%></select>
小类<select name="Nclassid">
<%rs.open "select * from sort2 where anclassid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%><option selected value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
<% rs.movenext
do while not rs.eof%><option value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
<% rs.movenext
loop
end if
rs.close
%></select></td>
</tr>
<tr>
<td width="13%">商品品牌</td>
<td colspan="2"><input name="pingpai" type="text" id="pingpai" size="20">
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from pingpai where anclassid='"&selclass&"' order by pingpaiorder",conn,1,1
%><select name="select" onchange="(document.myform.pingpai.value=this.options[this.selectedIndex].value)"><option selected>请选择品牌</option>
<%
while not rs.eof
%><option value="<%=rs("pingpainame")%>"><%=rs("pingpainame")%></option>
<%
rs.movenext
wend
rs.close
%></select>
</td>
</tr>

-----------------------------

如何让商品品牌也像小类一样随着大类的变化而有不同的选择

高手帮帮忙 谢谢了
不太明白
详细点好吗?
本人菜鸟

主要是商品品牌在网页出来时就选择好了,再变大类就只有小类跟着变了,品牌不变 就是说
rs.open "select * from pingpai where anclassid='"&selclass&"' order by pingpaiorder",conn,1,1
里面的"&selclass&"在选择前就确定了,再大类变了后
"&selclass&"并不变

给个解决方案 谢谢了

<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from pingpai where anclassid='"&selclass&"' order by pingpaiorder",conn,1,1
%>
在句中将你要改变的表作为动态的不就行了么?把pingpai作为一个动态的表来操作"select * from " +pingpai+ " where
if ...
pingpai=
elseif..
pingpai=
....