<SCRIPT LANGUAGE=javascript> skind_1='0'; sskind_1='0'; prvarr= new Array(170); ctylst= new Array(1000); <% dim i,j i=1 j=1 set rsk=server.CreateObject("adodb.recordset") rsk.open "select distinct type from 库存表",conn,1if not rsk.eof then
response.Write("prvcnt=")%>
<%=rsk.recordcount+1%>
<% response.Write(";"+chr(13)+chr(10)) else response.Write("prvcnt=0;"+chr(13)+chr(10)) end ifresponse.Write("prvarr["+cstr(i)+"]=new prv('0','0','请选择类型');"+chr(13)+chr(10)) response.Write("ctylst["+cstr(j)+"]=new prvcty('0','0','请选择名称','0');"+chr(13)+chr(10)) set rskk=server.CreateObject("adodb.recordset") i=i+1 j=j+1while not rsk.eof rskk.open "select name from 库存表 where type='"+rsk.fields("type")+"'",conn response.Write("prvarr["+cstr(i)+"]=new prv("+cstr(i-1)+",'"+rsk.fields("type")+"','"+rsk.fields("type")+"');"+chr(13)+chr(10))
response.Write("ctylst["+cstr(j)+"]=new prvcty("+cstr(i-1)+",'0','请选择名称','0');"+chr(13)+chr(10)) j=j+1 while not rskk.eof response.Write("ctylst["+cstr(j)+"]=new prvcty("+cstr(i-1)+",'"+rskk.fields("name")+"','"+rskk.fields("name")+"','"+rsk.fields("type")+"');"+chr(13)+chr(10)) j=j+1 rskk.movenext wend
rskk.close rsk.movenext i=i+1 wend response.Write("ctycnt="+cstr(j-1)+";") rsk.close set rsk=nothing set rskk=nothing %>function prvcty(pid,cid,name,sid) {this.pid=pid;this.cid=cid;this.name=name;this.sid=sid;} function prv(id,kid,name) {this.id=id;this.kid=kid;this.name=name;} function ctychg(n,k) {
lth=document.form.t97.length for (i=0;i<=lth;i++) { document.form.t97.remove(0); }
for (j=1;j<=ctycnt;j++) { if (ctylst[j].sid==n ) { var oOption = document.createElement("OPTION"); oOption.text=ctylst[j].name; oOption.value=ctylst[j].cid; document.form.t97.add(oOption); if (ctylst[j].cid==k) { oOption.selected=1; cityname = ctylst[j].name;
skind_1='0';
sskind_1='0';
prvarr= new Array(170);
ctylst= new Array(1000);
<%
dim i,j
i=1
j=1
set rsk=server.CreateObject("adodb.recordset")
rsk.open "select distinct type from 库存表",conn,1if not rsk.eof then
response.Write("prvcnt=")%>
<%=rsk.recordcount+1%>
<% response.Write(";"+chr(13)+chr(10))
else
response.Write("prvcnt=0;"+chr(13)+chr(10))
end ifresponse.Write("prvarr["+cstr(i)+"]=new prv('0','0','请选择类型');"+chr(13)+chr(10))
response.Write("ctylst["+cstr(j)+"]=new prvcty('0','0','请选择名称','0');"+chr(13)+chr(10))
set rskk=server.CreateObject("adodb.recordset")
i=i+1
j=j+1while not rsk.eof
rskk.open "select name from 库存表 where type='"+rsk.fields("type")+"'",conn
response.Write("prvarr["+cstr(i)+"]=new prv("+cstr(i-1)+",'"+rsk.fields("type")+"','"+rsk.fields("type")+"');"+chr(13)+chr(10))
response.Write("ctylst["+cstr(j)+"]=new prvcty("+cstr(i-1)+",'0','请选择名称','0');"+chr(13)+chr(10))
j=j+1
while not rskk.eof
response.Write("ctylst["+cstr(j)+"]=new prvcty("+cstr(i-1)+",'"+rskk.fields("name")+"','"+rskk.fields("name")+"','"+rsk.fields("type")+"');"+chr(13)+chr(10))
j=j+1
rskk.movenext
wend
rskk.close
rsk.movenext
i=i+1
wend
response.Write("ctycnt="+cstr(j-1)+";")
rsk.close
set rsk=nothing
set rskk=nothing
%>function prvcty(pid,cid,name,sid) {this.pid=pid;this.cid=cid;this.name=name;this.sid=sid;} function prv(id,kid,name) {this.id=id;this.kid=kid;this.name=name;} function ctychg(n,k)
{
lth=document.form.t97.length
for (i=0;i<=lth;i++)
{
document.form.t97.remove(0);
}
for (j=1;j<=ctycnt;j++)
{
if (ctylst[j].sid==n )
{
var oOption = document.createElement("OPTION"); oOption.text=ctylst[j].name;
oOption.value=ctylst[j].cid;
document.form.t97.add(oOption); if (ctylst[j].cid==k)
{
oOption.selected=1;
cityname = ctylst[j].name;
}
oOption.empty;
}
}
}
</SCRIPT>
<html><body>
<select name='t96' onChange="ctychg(document.form.t96.value,'')">
<script language=javascript>
for(i=1;i<=prvcnt;i++)
{
document.write ('<option value=');
document.write (prvarr[i].kid);
//if (prvarr[i].name=='' )
//document.write (' selected');
document.write ('>');
document.write (prvarr[i].name);
document.write ('</option>');
}
</script>
</select><select name='t97'>
<script language=javascript>
{
ctychg(document.form.t96.value,'');
}
</script>
</select>
</body>
</html>