手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >javawscript 三级菜单的实现原理
javawscript 三级菜单的实现原理
摘要:省份:请选择山东省城市:==请选择==威海市德州市滨州市区县:==请选择乡镇==威海文登荣成乳山省份,城市,区县数据结构:【名称,父类ID,...

省份: 请选择 山东省
城市: ==请选择==威海市德州市滨州市
区县:

==请选择乡镇==威海文登荣成乳山

省份,城市,区县数据结构:【名称,父类ID,当前ID】

onChange="changelocation2(document.editForm.smalllocation.options[document.editForm.smalllocation.selectedIndex].value)"

根据selectedIndex取得下一级关联菜单的父类ID,

复制代码 代码如下:

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('==请选择==','');

document.getElementById("dlmc0").options[0] = new Option('==请选择==','');

//alert(locationid);

var locationid=locationid;

var i;

document.editForm.smalllocation.options[0] = new Option('==请选择==','');

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]);

}

}

}

【javawscript 三级菜单的实现原理】相关文章:

javascript实现简单的进度条

JavaScript AOP编程实例

javascript实现日期按月份加减

javascript基于DOM实现权限选择实例分析

javascript搜索框效果实现方法

JavaScript中eval函数的问题

JavaScript实现Flash炫光波动特效

javascript实现Table排序的方法

JavaScript实现列表分页功能特效

在JavaScript中正确引用bind方法的应用

精品推荐
分类导航