|
省份: | |
城市: | |
區(qū)縣: |
|
省份,城市,區(qū)縣數(shù)據(jù)結(jié)構(gòu):【名稱,父類(lèi)ID,當(dāng)前ID】
onChange="changelocation2(document.editForm.smalllocation.options[document.editForm.smalllocation.selectedIndex].value)"
根據(jù)selectedIndex取得下一級(jí)關(guān)聯(lián)菜單的父類(lèi)ID,
復(fù)制代碼 代碼如下:
function changelocation(locationid)
{
document.editForm.smalllocation.length = 0;
// document.editForm.dlmc0.length = 0;
document.getElementById("dlmc0").length=0;
//document.editForm.dlmc0.options[0] = new Option('==請(qǐng)選擇==','');
document.getElementById("dlmc0").options[0] = new Option('==請(qǐng)選擇==','');
//alert(locationid);
var locationid=locationid;
var i;
document.editForm.smalllocation.options[0] = new Option('==請(qǐng)選擇==','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.editForm.smalllocation.options[document.editForm.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
JavaScript技術(shù):javawscript 三級(jí)菜單的實(shí)現(xiàn)原理,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。