复制代码代码如下:
<!-#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 ();
<%
count = 0
Dowhilenotrs.eof
%>
subcat [<%= count%>] = newarray ("<%= trim (rs (" shiname "))%>", "<%= trim (rs (" shengcode "))%>", "<%= trim (rs (" id "))%>");
<%
count = count+1
Rs.movenext
петля
Rs.close
%>
OneCount = <%= count%>;
functionChangeLocation (locationId)
{
document.form1.cid.length = 0;
varlocationId = locationId;
vari;
для (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;
returntrue
}
//->
</Script>
<formname = form1onsubmit = "check ()">
省份 <%
sql = "select*fromshenginfo"
Rs.opensql, Conn, 1,1
ifrs.eofandrs.bofthen
response.write "请先添加省份。"
response.end
еще
%>
<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
петля
эндиф
Rs.close
%>
</Select>