<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <mce:script language="javascript"><!-- zwList=new Array(); var j; j=0; //职位名,部门id,职位id zwList[0]=new Array("职位一","1","1"); zwList[1]=new Array("职位二","1","2"); zwList[2]=new Array("职位三","1","3"); zwList[3]=new Array("职位1","2","4"); zwList[4]=new Array("职位2","2","5"); zwList[5]=new Array("职位3","2","6"); j=6; function loadzw(bm_id){ var objzw=document.getElementById("list_zw") objzw.length=0; if (bm_id==0){ objzw.options[objzw.length] = new Option("请选择职位...", ""); return; } var i; for (i=0;i < j; i++){ if (zwList[i][1] == bm_id){ objzw.options[objzw.length] = new Option(zwList[i][0], zwList[i][2]); } } } // --></mce:script> <body> <form id="form1"> <select name="list_bm" onChange="loadzw(this.options[this.selectedIndex].value)"> <option value="0">请选择部门...</option> <option value="1">部门一</option> <option value="2">部门二</option> </select> <select name="list_zw" id="list_zw"> <option value="">请选择职位...</option> </select> </form> </body> </html>