複製代碼代碼如下:
<! - #includefile =“ conn.asp” - >
<html>
<頭>
<metahttp-equiv =“ content-type” content =“ text/html; charset = gb2312”>
<metaname =“ generator” content =“ microsoftFrontPage4.0”>
<metaname =“ progid” content =“ frontpage.editor.document”>
<title> newpage1 </title>
</head>
<身體>
<%
dimrs
DIMSQL
DIMCOUNT
setrs = server.createobject(“ adodb.recordset”)
sql =“ select*fromshiinfoorderbyidasc”
Rs.Opensql,Conn,1,1
%>
<ScriptLanguage =“ JavaScript”>
VaroneCount;
onecount = 0;
subcat = newarray();
<%
計數= 0
dowhilenotrs.eof
%>
subcat [<%= count%>] = newarray(“ <%= trim(rs(“ shiname”)%>”,“” <%= trim(rs(“ shengcode”))%>“,” <%= trim(rs(rs(id id'id'id'id')));
<%
計數=計數+1
Rs.Movenext
環形
Rs.Close
%>
onecount = <%= count%>;
功能ChangeLocation(位置ID)
{
document.form1.cid.length = 0;
varlationId = 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”>
<! -
functionCheckform()
{
document.form1.txtcontent.value = document.form1.doc_html.value;
返回
}
// - >
</script>
<formName = form1onsubmit =“ check()”>
省份<%
sql =“ select*fromshenginfo”
Rs.Opensql,Conn,1,1
ifrs.eofandrs.bofthen
響應。寫入“請先添加省份。”
響應
別的
%>
<selectName =“ sid” onChange =“ changeLocation(document.form1.sid.options [document.form1.sid.seledectexex] .value)。
dowhilenotrs.eof
%> <optionsElectectectValue =“ <%= trim(rs(“ id”))%>“> <%= trim(rs(“ shengname”))%> </option>
<%
Rs.Movenext
環形
Endif
Rs.Close
%>
</select>