用JSP+JavaScript打造二级级联下拉菜单
百度广告
JSP+JavaScript打造二级级联下拉菜单:
级联菜单 var onecount; onecount=0; subcat = new Array(); subcat[] = new Array(,,); onecount=; function changelocation(locationid) { document.myform.NclassId.length = 0; var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i] == locationid) { document.myform.NclassId.options[document.myform.NclassId.length] = new Option(subcat[i][0], subcat[i][1]); } } }
级联菜单 var onecount; onecount=0; subcat = new Array(); subcat[] = new Array(,,); onecount=; function changelocation(locationid) { document.myform.NclassId.length = 0; var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i] == locationid) { document.myform.NclassId.options[document.myform.NclassId.length] = new Option(subcat[i][0], subcat[i][1]); } } }
class(一级栏目信息):classId(自动编号),className(栏目名称), Nclass(二级栏目信息), NclassId(自动编号),NclassName(栏目名称),parentId(一级栏目id,与class表中的classId关联)
一级分类 | ==请选一级分类== SELECT * FROM class $ | 选择二级分类 | ==请选二级分类== |
一级分类 | ==请选一级分类== SELECT * FROM class $ | 选择二级分类 | ==请选二级分类== |
编辑推荐:
下载Word文档
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>