源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

javawscript 三级菜单的实现原理

  • 时间:2020-02-08 18:59 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:javawscript 三级菜单的实现原理
省份:
城市:
区县:
省份,城市,区县数据结构:【名称,父类ID,当前ID】  onChange="changelocation2(document.editForm.smalllocation.options[document.editForm.smalllocation.selectedIndex].value)" 根据selectedIndex取得下一级关联菜单的父类ID,
[u]复制代码[/u] 代码如下:
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]); } } }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部