复制代码 代码如下:
<>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<metaname="GENERATOR"content="MicrosoftFrontPage4.0">
<metaname="ProgId"content="FrontPage.Editor.Document">
<title>NewPage1</title>
</head>
<body>
<%
dimrs
dimsql
dimcount
setrs=server.createobject("adodb.recordset")
sql="select*fromshiinfoorderbyidasc"
rs.opensql,conn,1,1
%>
<SCRIPTlanguage="JavaScript">
varonecount;
onecount=0;
subcat=newArray();
<%
count=0
dowhilenotrs.eof
%>
subcat[<%=count%>]=newArray("<%=trim(rs("shiname"))%>","<%=trim(rs("shengcode"))%>","<%=trim(rs("id"))%>");
<%
count=count+1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
functionchangelocation(locationid)
{
document.form1.cid.length=0;
varlocationid=locationid;
vari;
for(i=0;i<onecount;i++)
{
if(subcat[i][1]==locationid)
{
document.form1.cid.options[document.form1.cid.length]=newOption(subcat[i][0],subcat[i][2]);
}
}
}
</SCRIPT>
<SCRIPTlanguage="javascript">
<>
</SCRIPT>
<formname=form1onsubmit="check()">
省份<%
sql="select*fromshenginfo"
rs.opensql,conn,1,1
ifrs.eofandrs.bofthen
response.write"请先添加省份。"
response.end
else
%>
<Selectname="sid"onChange="changelocation(document.form1.sid.options[document.form1.sid.selectedIndex].value)"><%
dowhilenotrs.eof
%><OPTIONselectedvalue="<%=trim(rs("id"))%>"><%=trim(rs("shengname"))%></OPTION>
<%
rs.movenext
loop
endif
rs.close
%>
</Select>
城市:<Selectname="cid">
<OPTIONselectedvalue="">==请选城市==</OPTION>
</Select>
</form>
</body>
</html>