您现在的位置是:网站首页> 编程资料编程资料

网上用的比较多的asp级联菜单效果代码_应用技巧_

2023-05-25 151人已围观

简介 网上用的比较多的asp级联菜单效果代码_应用技巧_

复制代码 代码如下:

 
 
 
 
 
 
New Page 1 
 
 
<% 
dim rs 
dim sql 
dim count 
set rs=server.createobject("adodb.recordset") 
sql = "select * from shiinfo order by id asc" 
rs.open sql,conn,1,1 
%> 

 
var onecount; 
onecount=0; 
subcat = new Array(); 
<% 
count = 0 
do while not rs.eof  
%> 
subcat[<%=count%>] = new Array("<%= trim(rs("shiname"))%>","<%= trim(rs("shengcode"))%>","<%= trim(rs("id"))%>"); 
<% 
count = count + 1 
rs.movenext 
loop 
rs.close 
%> 
onecount=<%=count%>; 
function changelocation(locationid) 

document.form1.cid.length = 0;  
var locationid=locationid; 
var i; 
for (i=0;i < onecount; i++) 

if (subcat[i][1] == locationid) 
{  
document.form1.cid.options[document.form1.cid.length] = new Option(subcat[i][0], subcat[i][2]); 
}  

}  

 
 
 
 
 
省份 <% 
sql = "select * from shenginfo" 
rs.open sql,conn,1,1 
if rs.eof and rs.bof then 
response.write "请先添加省份。" 
response.end 
else 
%> 
<%  
do while not rs.eof 
%>"><%=trim(rs("shengname"))%> 
<% 
rs.movenext 
loop 
end if 
rs.close 
%> 
  
城市: 
==请选城市== 
 
 
 

-六神源码网