主頁 > 知識庫 > asp動態(tài)級聯(lián)菜單代碼

asp動態(tài)級聯(lián)菜單代碼

熱門標(biāo)簽:服務(wù)器配置 阿里云 銀行業(yè)務(wù) Mysql連接數(shù)設(shè)置 電子圍欄 科大訊飛語音識別系統(tǒng) 團購網(wǎng)站 Linux服務(wù)器
JS腳本:
%
dim rs
dim sql
dim count
dim rs1
dim sql1
sql = "select * from region order by zoneid asc"
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,3
%>
script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
%
count = 0
do while not rs.eof
%>
subcat[%=count%>] = new Array("%= trim(rs("regionname"))%>","%= trim(rs("zoneid"))%>","%= trim(rs("regionid"))%>");
%
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing
%>
onecount=%=count%>;

function changelocation(zoneid)
{
document.myform.region.length = 0;

var zoneid=zoneid;
var i;
document.myform.region.options[0] = new Option('--地區(qū)--','');
for (i=0;i  onecount; i++)
{
if (subcat[i][1] == zoneid)
{
document.myform.region.options[document.myform.region.length] = new Option(subcat[i][0], subcat[i][2]);
}
}

}
/script> 

表單內(nèi)容:
table>
form>
tr>
td>
span class="STYLE1">*/span> 大區(qū):
          select name="zone" size="1" id="zone" onChange="changelocation(document.myform.zone.options[document.myform.zone.selectedIndex].value)">
option value=0 selected >請選擇/option>
%

sql1 = "select * from bigzone order by zonename asc"
set rs1 = server.createobject("adodb.recordset")
rs1.open sql1,conn,1,3
%>
%while not rs1.eof%>
option value="%=rs1("zoneid")%>">%=rs1("zonename")%>/option>
%rs1.movenext
wend
rs1.close
set rs1 = nothing
%>
/select>        /td>
        td width="20%">span class="STYLE1">*/span>地區(qū):
          select name="region" size="1" id="region" >
option value=0 selected >請選擇/option>
/select>  
/tr>
/form>
/table>

標(biāo)簽:大理 衡水 蚌埠 棗莊 萍鄉(xiāng) 廣元 江蘇 衢州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp動態(tài)級聯(lián)菜單代碼》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266