| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1686 人关注过本帖
标题:为什么用ASP编写的二级菜单不能显示啊????????????
只看楼主 加入收藏
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

1.admin_Newsadd1.asp


<%pagename="admin_newsadd"%>
<!--#include file="session.asp"-->
<%checkadmin1%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="top.asp"-->

<script language="javascript">
function smlcls_Change(val)
{
document.form1.smallclassid.value=val;
}
</script>

<table border="1" width="755" cellspacing="0" cellpadding="1" bgcolor="<%=mainbgcolor%>">
<tr>
<td valign=top width=20%><!--#include file="admin_left.asp"--></td>
<td valign=top>
<form name="form1" method="post" action="admin_newsadd2.asp">
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="tableline" bordercolorlight="<%=mainbcolor%>" bgcolor="<%=mainccolor%>">
<tr>
<td width="100%" height="20" colspan=2 align=center bgcolor="<%=maintcolor%>"><b>增 加 新 闻</b></td>
</tr>
<tr>
<td align="center">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>
<%
sql="select * from bigclass order by bigclassid"
rs.open sql,conn,1,1
%>
<select name="bigclassname" size="1" onChange="window.open('admin_newsadd1.asp?bigclassname='+this.options[this.selectedindex].value,'_self')">
<option value=""
<%
if request("bigclassname")="" then
%>
selected
<%
end if
%>>选择大类</option>
<%
if session("key")="super" or session("key")="senior" then '如果是高级以上管理员
While not rs.eof
%>
<option
<%
IF request("bigclassname")=rs("bigclassname") and request("bigclassname")<>"" then
%>
selected
<%
End if
%>
value="<%=rs("bigclassname")%>" name=bigclassname><%=rs("bigclassname")%></option>
<%
RS.movenext
wend
Else
While not rs.eof
If instr(rs("bigclassmaster"),session("username"))<>0 then '如果是大类管理员
%>
<option
<%
if request("bigclassname")=rs("bigclassname") and request("bigclassname")<>"" then
%>
selected
<%
end if
%>
value="<%=rs("bigclassname")%>" name=bigclassname><%=rs("bigclassname")%></option>
<%
end if
set rs1=server.createobject ("adodb.recordset") '如果小类有这个大类管理员
sql1="select * from smallclass where bigclassname='"& rs("bigclassname") & "' and instr(smallclassmaster,'"&session("username")&"')<>0"
rs1.open sql1,conn,1,1
if not rs1.eof then
%>
<option
<%
if request("bigclassname")=rs("bigclassname") and request("bigclassname")<>"" then
%>
selected
<%
end if
%>
value="<%=rs("bigclassname")%>" name=bigclassname><%=rs("bigclassname")%></option>
<%
end if
rs1.close
set rs1=nothing
rs.movenext
wend
end if

%>
</select>
<%
if request("bigclassname")<>"" then
%>
<select name="smlclsid" onChange="smlcls_Change(this.options[this.selectedIndex].value);" size="1">
<option value=""
<%
if request("smallclassid")="" then
%>
selected
<%
end if
%>>选择小类</option>
<%
set trs=server.createobject("adodb.recordset")
if session("key")="inter" then
set rs1=server.createobject("adodb.recordset")
sql1="select bigclassmaster from bigclass where bigclassname='"&request("bigclassname")&"'"
rs1.open sql1,conn,1,1
if instr(rs1("bigclassmaster"),session("username"))<>0 then
sql="select * from smallclass where bigclassname='"&request("bigclassname")&"' order by smallclassid"
else
sql="select * from smallclass where "
sql=sql&" instr(smallclassmaster,'"&session("username")&"')<>0 and "
sql=sql&"bigclassname='"&request("bigclassname")&"' order by smallclassid"
end if
rs1.close
set rs1=nothing
end if
if session("key")="super" or session("key")="senior" then
sql="select * from smallclass where bigclassname='"&request("bigclassname")&"' order by smallclassid"
if session("key")="input" or session("key")="check" then
sql="select * from smallclass where "
sql=sql&"bigclassname='"&request("bigclassname")&"' and "
sql=sql&"instr(smallclassmaster,'"&session("username")&"')<>0 order by smallclassid"

trs.open sql,conn,1,1
do while not trs.eof
%>
<option
<%
if cstr(request("smallclassid"))=cstr(trs("smallclassid")) and request("smallclassid")<>"" then
%>
selected
<%
end if
%>
value="<%=cstr(trs("smallclassid"))%>" name=smallclassid><%=trs("smallclassname")%></option>
<%
trs.movenext
loop
trs.close
%>
<%
else
%>
<select name="smallclsid" onChange="smlcls_Change(this.options[this.selectedIndex].value);" size="1">
<option value="" selected>选择小类</option>
<%end if%>
</select>
<input name="smallclassid" type="hidden" >
</p>
<p>&nbsp;</p>
<p>&nbsp; </p>
</td>
</tr>
<tr>
<td align="center" height="25">

<input type="submit" value=" 确 定 " name="cmdok">

</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%
rs.close
set trs=nothing
set rs=nothing
%>
<!--#include file="copyright.asp"-->

小类显示不出来跟红字的代码应该有关系,那个查询的问题,个人觉得楼主的代码逻辑上过于混乱。像这种问题着重使用javascript比着重使用服务器端代码要好。

2007-08-18 17:00
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
我很早以前写的二级联动源代码,里面用的是省市联动
选择省份第二个列表框显示相应的城市
[CODE]<!--#include file="UserControl.asp"-->
<!--#include file="Cls\WebSiteSetInf.asp"-->
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<%
'网页样式初始化代码
Dim PageStyleT
Dim oWebI
Set oWebI=New WebSetInf
Set PageStyleT=New PageStyle
Call QueryStyle("真实资料修改",PageStyleT)
%>
<TITLE><%=oWebI.WebName%>-真实资料修改</TITLE>
<style type="text/css">
<!--
<%=PageStyleT.StyleString%>
-->
</style>
<STYLE type=text/css>
<!--
body {
background-color: <%=PageStyleT.BackGround%>;
}
.style4 {font-size: 14px}
.style5 {font-size: 12px}
-->
</STYLE>
<%
'网页初始化区域
Dim UsR
Dim ControlR
Dim UsName
Dim rsRe
Set UsR=New User
Set ControlR=New UserControl
IF Session("UserName")<>"" Then
UsName=Session("UserName")
Else
Response.Redirect "ErrPage.asp?ErrorMessage=您还没有登录请先登陆"
End IF
ControlR.Initialize
ControlR.ReturnReaInformation UsName,UsR
ControlR.ReturnWebSiteInformation UsName,UsR
ControlR.ReturnBasicInformation UsName,UsR
UsR.UserBirthday=ControlR.RuturnBirthday(UsName)
UsR.UserSex=ControlR.RuturnSex(UsName)
%>
<script language="javascript">
//声明信息储存变量
var UserRealName;
var UserNation;
var UserProvince;
var UserCity;
var UserJob;
var UserEdu;
var UserBlood;
var UserZodiac;
var UserBelieve;
var UserPhone;
var UserMailAddress;
var UserBiref;
//网页初始化函数
function PageInit()
{
document.fUserBiref.UserBiref.value=document.fUserBiref.bValue.value;
<%
'服务器端输入有效性验证代码'
Dim ReFalse
ReFalse="T"
IF Request.Form("IsSubmit")="T" Then
'//TODO:服务器端有效性验证代码'
IF Request.Form("UserRealName")="" Then
Response.Write("alert("&"""真实姓名为空"""&");")
ReFalse="F"
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserRealName"))>10 Then
Response.Write("alert("&"""真实姓名长度过大,注:最大10个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserNation")="" Then
Response.Write("alert("&"""国家为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserNation"))>10 Then
Response.Write("alert("&"""国家长度过大,注:最大10个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserProvince")="" Then
Response.Write("alert("&"""省份为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserProvince"))>10 Then
Response.Write("alert("&"""省份长度过大,注:最大10个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserCity")="" Then
Response.Write("alert("&"""城市为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserCity"))>10 Then
Response.Write("alert("&"""城市长度过大,注:最大10个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserJob")="" Then
Response.Write("alert("&"""职业为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserJob"))>50 Then
Response.Write("alert("&"""职业长度过大,注:最大50个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserEdu")="" Then
Response.Write("alert("&"""学历为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserEdu"))>50 Then
Response.Write("alert("&"""学历长度过大,注:最大50个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserBlood")="" Then
Response.Write("alert("&"""血型为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserBlood"))>7 Then
Response.Write("alert("&"""血型长度过大,注:最大7个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserBelieve")="" Then
Response.Write("alert("&"""信仰为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Len(Request.Form("UserJob"))>50 Then
Response.Write("alert("&"""信仰长度过大,注:最大50个字符"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserPhone")="" Then
Response.Write("alert("&"""电话为空"""&");")
ReFalse="F"
Else
IF ReFalse<>"F" Then
On Error Resume Next
IF VarType(CDbl(Request.Form("UserPhone")))<>5 Then
Response.Write("alert("&"""电话非数字"""&");")
ReFalse="F"
End IF
End IF
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserMailAddress")="" Then
Response.Write("alert("&"""通讯地址为空"""&");")
ReFalse="F"
End IF
End IF
IF ReFalse<>"F" Then
IF Request.Form("UserBiref")<>"" Then
IF Len(Request.Form("UserBiref"))>300 Then
Response.Write("alert("&"""签名长度大于300个字"""&");")
ReFalse="F"
End IF
End IF
End IF
IF ReFalse<>"F" Then
UsR.UserRealName=Request.Form("UserRealName")
UsR.UserNation=Request.Form("UserNation")
UsR.UserProvince=Request.Form("UserProvince")
UsR.UserCity=Request.Form("UserCity")
UsR.UserJob=Request.Form("UserJob")
UsR.UserEdu=Request.Form("UserEdu")
UsR.UserZodiac=Request.Form("UserZodiac")
UsR.UserBlood=Request.Form("UserBlood")
UsR.UserBelieve=Request.Form("UserBelieve")
UsR.UserPhone=Request.Form("UserPhone")
UsR.UserMailAdderss=Request.Form("UserMailAddress")
UsR.UserBiref=Request.Form("UserBiref")
Set rsRe=Server.CreateObject("ADODB.RecordSet")
rsRe.Open "UserReal",con,1,3
Do Until rsRe.EOF
IF rsRe.Fields(1).value=UsR.UserName Then
Exit Do
End IF
rsRe.MoveNext
Loop
IF rsRe.EOF=True Then
Dim SQLInst
SQLInst="INSERT INTO UserReal VALUES("
SQLInst=SQLInst&UsR.UserID&","
SQLInst=SQLInst&"'"&UsR.UserName&"',"
SQLInst=SQLInst&"'"&UsR.UserRealName&"',"
SQLInst=SQLInst&"'"&UsR.UserNation&"',"
SQLInst=SQLInst&"'"&UsR.UserProvince&"',"
SQLInst=SQLInst&"'"&UsR.UserCity&"',"
SQLInst=SQLInst&"'"&UsR.UserJob&"',"
SQLInst=SQLInst&"'"&UsR.UserEdu&"',"
SQLInst=SQLInst&"'"&UsR.UserZodiac&"',"
SQLInst=SQLInst&"'"&UsR.UserBlood&"',"
SQLInst=SQLInst&"'"&UsR.UserBelieve&"',"
SQLInst=SQLInst&UsR.UserPhone&","
SQLInst=SQLInst&"'"&UsR.UserMailAdderss&"',"
SQLInst=SQLInst&"'"&UsR.UserBiref&"'"
SQLInst=SQLInst&")"
Response.Write "//"&SQLInst&Chr(13)
con.Execute SQLInst
Else
Dim SQLUpdate
SQLUpdate="UPDATE UserReal SET "
SQLUpdate=SQLUpdate&"UserRealityName='"&UsR.UserRealName&"',"
SQLUpdate=SQLUpdate&"UserNation='"&UsR.UserNation&"',"
SQLUpdate=SQLUpdate&"UserPro='"&UsR.UserProvince&"',"
SQLUpdate=SQLUpdate&"UserCity='"&UsR.UserCity&"',"
SQLUpdate=SQLUpdate&"UserJob='"&UsR.UserJob&"',"
SQLUpdate=SQLUpdate&"UserEdu='"&UsR.UserEdu&"',"
SQLUpdate=SQLUpdate&"UserZodiac='"&UsR.UserZodiac&"',"
SQLUpdate=SQLUpdate&"UserBlood='"&UsR.UserBlood&"',"
SQLUpdate=SQLUpdate&"UserBelieve='"&UsR.UserBelieve&"',"
SQLUpdate=SQLUpdate&"UserPhone="&UsR.UserPhone&","
SQLUpdate=SQLUpdate&"UserMailAdderss='"&UsR.UserMailAdderss&"',"
SQLUpdate=SQLUpdate&"UserBiref='"&UsR.UserBiref&"'"
SQLUpdate=SQLUpdate&" WHERE UserName='"&UsR.UserName&"'"
con.Execute SQLUpdate
End IF
Response.Write("alert("&"""信息修改成功"""&");")
End IF
End IF
%>
}
//两级联动下拉列表函数
function SelCityChange(txt)
{
var tAry;
var tAryNum;
var tNum;
document.City.textCity.value=txt;
tAryNum=0;
tNum=0;
for(var i=0;i<document.townAry.town.length;i++)
{
if(document.townAry.town[i].id==txt)
{
tAryNum=tAryNum+1
}
}
tAry=new Array(tAryNum);
for(var j=0;j<document.townAry.town.length;j++)
{
if(document.townAry.town[j].id==txt)
{
tAry[tNum]=document.townAry.town[j].value;
tNum=tNum+1
}
}
document.Town.selTown.options.length=tAryNum;
for(var k=0;k<tAryNum;k++)
{
document.Town.selTown.options[k].value=tAry[k];
document.Town.selTown.options[k].text=tAry[k];
}
}
//生肖选择函数
function SelZobidac(txt)
{
UserZodiac=txt;
}
//重填按钮函数
function ResetForm()
{
document.fUserRealName.UserRealName.value="";
document.fUserNation.UserNation.value="";
document.City.textCity.value="";
document.Town.textTown.value="";
document.fUserJob.UserJob.value="";
document.fUserEdu.UserEdu.value="";
document.fUserBlood.UserBlood.value="";
document.fUserBelieve.UserBelieve.value="";
document.fUserPhone.UserPhone.value="";
document.fUserMailAddress.UserMailAddress.value="";
document.fUserBiref.UserBiref.value="";
}
//客户端验证提交函数
function VerifyCilck()
{
//得到提交信息
UserRealName=document.fUserRealName.UserRealName.value;
UserNation=document.fUserNation.UserNation.value;
UserProvince=document.City.textCity.value;
UserCity=document.Town.textTown.value;
UserJob=document.fUserJob.UserJob.value;
UserEdu=document.fUserEdu.UserEdu.value;
UserBlood=document.fUserBlood.UserBlood.value;
UserBelieve=document.fUserBelieve.UserBelieve.value;
UserPhone=document.fUserPhone.UserPhone.value;
UserMailAddress=document.fUserMailAddress.UserMailAddress.value;
UserBiref=document.fUserBiref.UserBiref.value;
//有效性验证
if(confirm("确认所有信息以填写正确?"))
{
if(UserRealName=="")
{
alert("真实姓名为空");
return false;
}
if(UserNation=="")
{
alert("国家为空");
return false;
}
if(UserProvince=="")
{
alert("省份为空");
return false;
}
if(UserCity=="")
{
alert("城市为空");
return false;
}
if(UserJob=="")
{
alert("职业为空");
return false;
}
if(UserEdu=="")
{
alert("学历为空");
return false;
}
if(UserBlood=="")
{
alert("血型为空");
return false;
}
if(UserBelieve=="")
{
alert("信仰为空");
return false;
}
if(UserPhone=="")
{
alert("电话为空");
return false;
}
if(UserMailAddress=="")
{
alert("通讯地址为空");
return false;
}
if(UserZodiac=="")
{
alert("请选择属性");
return false;
}
//将信填写息赋给表单并提交到服务器
document.SubFrom.UserRealName.value=UserRealName;
document.SubFrom.UserNation.value=UserNation;
document.SubFrom.UserProvince.value=UserProvince;
document.SubFrom.UserCity.value=UserCity;
document.SubFrom.UserJob.value=UserJob;
document.SubFrom.UserEdu.value=UserEdu;
document.SubFrom.UserZodiac.value=UserZodiac;
document.SubFrom.UserBlood.value=UserBlood;
document.SubFrom.UserBelieve.value=UserBelieve;
document.SubFrom.UserPhone.value=UserPhone;
document.SubFrom.UserMailAddress.value=UserMailAddress;
document.SubFrom.UserBiref.value=UserBiref;
document.SubFrom.IsSubmit.value="T";
document.SubFrom.submit();
}
}
</script>
<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD>
<BODY onLoad="PageInit();">
<TABLE cellSpacing=0 cellPadding=0 width=387 height="377" border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD height=20 colspan="2" vAlign=top>
<DIV align=center class=style4>
<div align="left">真实姓名</div>
</DIV></TD>
<TD colspan="5" vAlign=top><form name="fUserRealName" method="post" style="height:20px ">
<input type="text" style="width:120px; height:20px " name="UserRealName" value=<%=UsR.UserRealName%>>
</form></TD>
<TD colspan="3" vAlign=top>
<DIV class=style4
align=center>国家</DIV></TD>
<TD colspan="4" vAlign=top><form name="fUserNation" style="height:20px" method="post">
<input type="text" style="width:155px; height:20px" name="UserNation" value=<%=UsR.UserNation%>>
</form></TD>
</TR>
<TR>
<TD width="33" height=20 vAlign=top>
<DIV align=center><SPAN
class=style4>省份</SPAN></DIV></TD>
<TD colspan="5" vAlign=top>
<form name="City" method="post" style="height:20px ">
<input type="text" style="width:63px; height:20px"name="textCity" value=<%=UsR.UserProvince%>>
<select style="width:65px;height:15px" name="selCity" onChange="SelCityChange(City.selCity.options[selectedIndex].value)">
<option selected>请选择省份</option>
<%
Dim rsProvince
Set rsProvince=Server.CreateObject("ADODB.RecordSet")
rsProvince.Open "Province",con,1,3
Do Until rsProvince.EOF
Response.Write("<option value="&rsProvince.Fields(0).value&">"&rsProvince.Fields(0).value&"</option>"&Chr(13))
rsProvince.MoveNext
Loop
rsProvince.Close
Set rsProvince=Nothing
%>
</select>
</form></TD>
<TD colspan="3" vAlign=top>
<DIV align=center><SPAN
class=style4>城市</SPAN></DIV></TD>
<TD colSpan=5 vAlign=top><form name="Town" method="post" style="height:20px ">
<input type="text" style="width:63px; height:20px"name="textTown" value=<%=UsR.UserCity%>>
<select style="width:77px;height:15px" name="selTown" onChange="Town.textTown.value=Town.selTown.options[selectedIndex].value;">
<option selected>请选择城市</option>
</select>
</form></TD>
</TR>
<TR>
<TD height=20 vAlign=top>
<DIV align=center><SPAN
class=style4>职业</SPAN></DIV></TD>
<TD colspan="2" vAlign=top><form name="fUserJob" method="post" style="height:20px ">
<input style="width:87px; height:20px "type="text" name="UserJob" value="<%=UsR.UserJob%>">
</form></TD>
<TD width="30" vAlign=top>
<DIV align=center><SPAN
class=style4>学历</SPAN></DIV></TD>
<TD colspan="6" vAlign=top><form name="fUserEdu" method="post" style="height:20px ">
<input style="width:75px; height:20px "type="text" name="UserEdu" value=<%=UsR.UserEdu%>>
</form></TD>
<TD colSpan=2 vAlign=top>
<DIV align=center><SPAN
class=style4>血型</SPAN></DIV></TD>
<TD colspan="2" vAlign=top><form name="fUserBlood" method="post">
<input style="width:116px; height:20px; "type="text" name="UserBlood" value=<%=UsR.UserBlood%>>
</form></TD>
</TR>
<TR>
<TD height=20 vAlign=top>
<DIV align=center><SPAN
class=style4>生肖</SPAN></DIV></TD>
<TD colspan="4" vAlign=top><form name="fUserZodiac" method="post">
<select name="UserZodiac" style="width:120px; height:13px" onChange="SelZobidac(fUserZodiac.UserZodiac.options[selectedIndex].value);">
<%
IF UsR.UserZodiac="" Then
Response.Write("<option selected>请&nbsp;选&nbsp;择&nbsp;生&nbsp;肖</option>"&Chr(13))
Else
Response.Write("<option value="&UsR.UserZodiac&"selected>"&UsR.UserZodiac&"</option>"&Chr(13))
End IF
%>
<option value="鼠">子&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鼠</option>
<option value="牛">丑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;牛</option>
<option value="虎">寅&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;虎</option>
<option value="兔">牟&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;兔</option>
<option value="龙">晨&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龙</option>
<option value="蛇">巳&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;蛇</option>
<option value="马">午&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;马</option>
<option value="羊">未&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;羊</option>
<option value="猴">申&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;猴</option>
<option value="鸡">酉&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鸡</option>
<option value="狗">戌&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;狗</option>
<option value="猪">亥&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;猪</option>
</select>
</form></TD>
<TD colspan="3" vAlign=top>
<DIV align=center><SPAN
class=style4>信仰</SPAN></DIV></TD>
<TD colSpan=6 vAlign=top><form name="fUserBelieve" method="post">
<input style="width:180px; height:20px "type="text" name="UserBelieve" value=<%=UsR.UserBelieve%>>
</form></TD>
</TR>
<TR>
<TD height=20 colspan="2" vAlign=top>
<div align="left"><SPAN
class=style4>联系电话</SPAN></div></TD>
<TD colspan="4" vAlign=top><form name="fUserPhone" method="post">
<input style="width:110px; height:20px "type="text" name="UserPhone" value=<%=UsR.UserPhone%>>
</form></TD>
<TD colspan="5" vAlign=top>
<DIV align=center><SPAN
class=style4>通讯地址</SPAN></DIV></TD>
<TD colSpan=3 vAlign=top><form name="fUserMailAddress" method="post">
<input style="width:142px; height:20px "type="text" name="UserMailAddress" value=<%=UsR.UserMailAdderss%>>
</form></TD>
</TR>
<TR>
<TD height=12 colSpan=14 vAlign=top>
<DIV
align=center class=style5>个&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;简&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;介</DIV></TD>
</TR>
<TR>
<TD height=87 colSpan=14 vAlign=top><form name="fUserBiref" method="post">
<div align="center">
<TEXTAREA style="WIDTH: 387px; HEIGHT: 70px" name="UserBiref" rows=3 cols=42 ALIGN="BOTTOM"></TEXTAREA>
<input name="bValue" type="hidden" value="<%=Server.HTMLEncode(UsR.UserBiref)%>">
</div>
</form></TD>
</TR>
<TR>
<TD height=21 colSpan=14 vAlign=top>
<DIV align=center><INPUT type="button" value=确定 name=Submit onClick="VerifyCilck();">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <INPUT type=Button value=重填 name=Submit2 onClick="ResetForm();">
</DIV></TD>
</TR>
<TR>
<TD height="20" colspan="13" vAlign=top>
<form name="SubFrom" method="post" action="UserRealityEdit.asp">
<input type="hidden" name="UserRealName">
<input type="hidden" name="UserNation">
<input type="hidden" name="UserProvince">
<input type="hidden" name="UserCity">
<input type="hidden" name="UserJob">
<input type="hidden" name="UserEdu">
<input type="hidden" name="UserZodiac">
<input type="hidden" name="UserBlood">
<input type="hidden" name="UserBelieve">
<input type="hidden" name="UserPhone">
<input type="hidden" name="UserMailAddress">
<input type="hidden" name="UserBiref">
<input type="hidden" name="IsSubmit">
</form></TD>
<td width="11"></td>
</TR>
<TR>
<TD height="43" colspan="13" vAlign=top>
<form name="townAry" method="post">
<%
Dim rsTown
Set rsTown=Server.CreateObject("ADODB.RecordSet")
rsTown.Open "City",con,1,3
Do Until rsTown.EOF
Response.Write("<input type=hidden name=town id="""&rsTown.Fields(0).value&""" value="&rsTown.Fields(1).Value&">"&Chr(13))
rsTown.MoveNext
Loop
%>
</form></TD>
<td></td>
</TR>
<TR>
<TD height="173">&nbsp;</TD>
<TD width="38">&nbsp;</TD>
<TD width="52">&nbsp;</TD>
<TD>&nbsp;</TD>
<TD width="19">&nbsp;</TD>
<TD width="9">&nbsp;</TD>
<TD width="11">&nbsp;</TD>
<TD width="15">&nbsp;</TD>
<TD width="14">&nbsp;</TD>
<TD width="11">&nbsp;</TD>
<TD width="13">&nbsp;</TD>
<TD width="25">&nbsp;</TD>
<TD width="106">&nbsp;</TD>
<td></td>
</TR>
</TBODY></TABLE>
</BODY>
<%
'网页对象析构区域
rsRe.Close()
Set rsRe=Nothing
Set PageStyleT=Nothing
Set UsR=Nothing
Set oWebI=Nothing
Set ControlR=Nothing
%>
</HTML>[/CODE]

2007-08-18 17:15
z8965600
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-8-16
收藏
得分:0 
回复:(yms123)我很早以前写的二级联动源代码,里面...

谢谢兄弟给我帮助.

有什么不明白再向兄弟请教啊.


努力学习ASP!!
2007-08-20 20:45
uj8yh
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2007-8-20
收藏
得分:0 
<!--#include file="../session.asp"-->
试试
2007-08-20 21:16
wfw18
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-3-20
收藏
得分:0 
我在预览时,二级菜单中没内容,急等版主大师帮忙!
若有高人指点,小弟不胜感激!全是从网上下载的代码,按说明做的,可在预览时,二级菜单中不显示一级菜单对应的内容
<select name="Class1" onChange="javascript:change_select(this.options[this.selectedIndex].value)">
<option value="0">选择分类</option>
<%
Set rs =Server.CreateObject("ADODB.RecordSet")
sql="select * from DH_Class1"
rs.open sql,conn,1,1
For i = 1 To rs.RecordCount%>
<option value="<%=rs("ID_Class1")%>"><%=rs("Name_Class1")%></option>
<%
rs.MoveNext
Next
rs.Close
sql="select * from DH_Class2"
rs.open sql,conn,1,1
%>
</select>
<select name="Class2">
<option value="0">选择小类别</option>
</select>
<script language = "javascript">
arrSelect=new Array();
arrSelect[0] = new Array("选择分类",0,0)
<%
For i = 1 To rs.RecordCount
%>
arrSelect[<%= i %>]=new Array("<%= rs("Name_Class2") %>","<%= rs("Class1ID") %>","<%= rs("ID_Class2") %>");
<%
rs.MoveNext
Next
rs.Close
Set rs=nothing
%>
function change_select(selvalue)
{
document.all.Class2.length=0;
var i;
for(i=0;i<arrSelect.length;i++)
{
if(arrSelect[1]==selvalue)
{
var newOption=new Option(arrSelect[0],arrSelect[2]);
document.all.Class2.add(newOption);
}
}
}
</script>
2008-03-20 22:29
快速回复:为什么用ASP编写的二级菜单不能显示啊????????????
数据加载中...
 
   



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

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