<!DOCTYPE html PUBLIC "//WC//DTD XHTML Transitional//EN" "
<html xmlns="
<head>
<meta http
equiv="Content
Type" content="text/html;charset=gb
" />
<title>雙選擇關聯菜單</title>
</head>
<body>
<form name="doublecombo">
<p>
<select name="example" size="
" onChange="redirect(this
options
selectedIndex)">
<option>特效代碼</option>
<option>網頁語言</option>
<option>軟件教程</option>
</select>
<select name="stage
" size="
">
<option value="/texiao/shubiao">鼠標類</option>
<option value="/texiao/chuangkou">窗口類</option>
<option value="/texiao/daohang">導航類</option>
</select>
<input type="button" name="test" value="Go!"
onClick="go()">
</p>
<script>
<!
var groups=document
doublecombo
example
options
length
var group=new Array(groups)
for (I=
; I<groups; I++)
group[I]=new Array()
group[
][
]=new Option("鼠標類"
"/texiao/shubiao")
group[
][
]=new Option("窗口類"
"/texiao/chuangkou")
group[
][
]=new Option("導航類"
"/texiao/daohang")
group[
][
]=new Option("ASP"
"/yuyan/asp")
group[
][
]=new Option("PHP"
"/yuyan/php")
group[
][
]=new Option("JSP"
"/yuyan/jsp")
group[
][
]=new Option("Dreamweaver"
"/ruanjian/Dreamweaver")
group[
][
]=new Option("Fireworks"
"/ruanjian/Fireworks")
group[
][
]=new Option("Flash"
"/ruanjian/Flash")
group[
][
]=new Option("Photoshop"
"/ruanjian/Photoshop")
var temp=document
doublecombo
stage
function redirect(x){
for (m=temp
options
length
;m>
;m
)
temp
options[m]=null
for (I=
;I<group[x]
length;I++){
temp
options[I]=new Option(group[x][I]
text
group[x][I]
value)
}
temp
options[
]
selected=true
}
function go(){
location=temp
options[temp
selectedIndex]
value
}
//
>
</script>
</form>
</body>
</html></td>
</tr>
</table>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20033.html