教程集 www.jiaochengji.com
教程集 >  脚本编程  >  javascript  >  正文 js经典级联菜单

js经典级联菜单

发布时间:2016-10-24   编辑:jiaochengji.com
教程集为您提供js经典级联菜单等资源,欢迎您收藏本站,我们将为您提供最新的js经典级联菜单资源
提示:您可以先修改部分代码再运行

<textarea name="runcool" rows="28" cols="75" >js经典级联菜单 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>js二级级联菜单</title> <script language="javascript"> var onecount; subcat = new Array(); subcat[0] = new Array("公司新闻","1","公司新闻"); subcat[1] = new Array("最新公告","1","最新公告"); subcat[2] = new Array("行业动态","2","行业动态"); subcat[3] = new Array("工程进展","2","工程进展"); subcat[4] = new Array("优秀员工","2","优秀员工"); onecount=5; function changelocation(locationid) { document.form1.SmallClassName.length = 1; var locationid=locationid; var i; for (i=0;i < onecount; i ) { if (subcat[i][1] == locationid) { document.form1.SmallClassName.options [document.form1.SmallClassName.length] = new Option(subcat[i][0], subcat[i] [2]); } } } function doChange(objText, objDrop){ if (!objDrop) return; var str = objText.value; var arr = str.split("|"); var nIndex = objDrop.selectedIndex; objDrop.length=1; for (var i=0; i<arr.length; i ){ objDrop.options[objDrop.length] = new Option(arr[i], arr[i]); } objDrop.selectedIndex = nIndex; } function form1_onsubmit() { if (document.form1.Title.value=="") { alert("文章标题不能为空!"); return false; } if (document.form1.SmallClassName.value=="") { alert("请指定子栏目!"); return false; } if (Editor1.getHTML()==""){ alert("文章内容不能为空!"); return false; } if (document.form1.Content.value.length>6553600) { alert("文章内容太长,超出了数据库的限制(64K)!建议将文章分成几部分录入 。"); return false; } return true; } </script> </head> <body> <select name="BigClassName" onchange="changelocation (document.form1.BigClassName.options [document.form1.BigClassName.selectedIndex].value)"> <option value="1">新闻中心</option> <option value="2">企业文化</option> </select> </span>
[关闭]
~ ~