묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
다중선택창선택하고 이동시키기
2006.02.18 20:34
http://www.kjga.or.kr/test.html<html>
<head>
<script language = "javascript">
//상위 셀렉트로 하위 셀렉트 제어하기
function showSub(obj) {
f = document.forms.select_machine;
if(obj == 1) {
f.SUB1.style.display = "";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 2) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 3) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 4) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 5) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 6) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 7) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 8) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 9) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "";
f.SUB10.style.display = "none";
}
if(obj == 10) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "";
}
}
function goURL()
{
if(this.go.value != "default")
{
URL = this.go.value
window.open(URL,'_self','+ '+ '')
}
}
</script>
</head>
<body>
<table cellpadding="0" cellspacing="0" width="500" border="0">
<tr>
<td width="100">
<form name="select_machine">
<!--상위 셀렉트박스-->
<select name=" " onChange="showSub(this.options[this.selectedIndex].value);">
<option value="1">1990</option>
<option value="2">1991</option>
<option value="3">1992</option>
<option value="4">1993</option>
<option value="5">1994</option>
<option value="6">1995</option>
<option value="7">1996</option>
<option value="8">1997</option>
<option value="9">1998</option>
<option value="10">1999</option>
</select>
</td>
<td width="300">
<!--//여기부턴 하위셀렉트박스-->
<select name="SUB1" style="display:block;"onChange="return goURL()">
<option value="http://www.naver.com">제 1회 한국 중.고등학교 골프연맹회장배 </option>
<option value="http://www.naver.com">제 1회 스포츠조선-엘로드배 </option>
<option value="http://www.naver.com">제 1회 KGM-그린국제골프배 </option>
</select>
<select name="SUB2" style="display: none;"onChange="return goURL()">
<option value="">제 2회 한국 중.고등학교 골프연맹회장배 </option>
<option value="">제 2회 스포츠조선-엘로드배 </option>
<option value="">제 2회 KGM-그린국제골프배 </option>
</select>
<select name="SUB3" style="display: none;"onChange="return goURL()">
<option value=" ">제 3회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 3회 스포츠조선-엘로드배 </option>
<option value=" ">제 3회 KGM-그린국제골프배 </option>
</select>
<select name="SUB4" style="display:none;"onChange="return goURL()">
<option value=" ">제 4회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 4회 스포츠조선-엘로드배 </option>
<option value=" ">제 4회 KGM-그린국제골프배 </option>
</select>
<select name="SUB5" style="display: none;"onChange="return goURL()">
<option value=" ">제 5회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 5회 스포츠조선-엘로드배 </option>
<option value=" ">제 5회 KGM-그린국제골프배 </option>
<option value=" ">제 1회 파맥스배 </option>
</select>
<select name="SUB6" style="display: none;"onChange="return goURL()">
<option value=" ">제 6회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 6회 스포츠조선-엘로드배 </option>
<option value=" ">제 6회 KGM-그린국제골프배 </option>
<option value=" ">제 2회 파맥스배 회</option>
</select>
<select name="SUB7" style="display:none;"onChange="return goURL()">
<option value=" ">제 7회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 7회 스포츠조선-엘로드배 </option>
<option value=" ">제 7회 KGM-그린국제골프배 </option>
<option value=" ">제 3회 파맥스배 </option>
</select>
<select name="SUB8" style="display: none;"onChange="return goURL()">
<option value=" ">제 8회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 2회 스포츠조선-엘로드배 </option>
<option value=" ">제 2회 KGM-그린국제골프배 </option>
</select>
<select name="SUB9" style="display: none;"onChange="return goURL()">
<option value=" ">제 9회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 3회 스포츠조선-엘로드배 </option>
<option value=" ">제 3회 KGM-그린국제골프배 </option>
</select>
<select name="SUB10" style="display: none;"onChange="return goURL()">
<option value=" ">제 10회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 3회 스포츠조선-엘로드배 </option>
<option value=" ">제 3회 KGM-그린국제골프배 </option>
</select>
</td>
<td width="100">
<input type = "button" value="이동" onclick="javascript:goURL()">
</td>
</tr>
</table>
</form>
<head>
<script language = "javascript">
//상위 셀렉트로 하위 셀렉트 제어하기
function showSub(obj) {
f = document.forms.select_machine;
if(obj == 1) {
f.SUB1.style.display = "";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 2) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 3) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 4) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 5) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 6) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 7) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 8) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "";
f.SUB9.style.display = "none";
f.SUB10.style.display = "none";
}
if(obj == 9) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "";
f.SUB10.style.display = "none";
}
if(obj == 10) {
f.SUB1.style.display = "none";
f.SUB2.style.display = "none";
f.SUB3.style.display = "none";
f.SUB4.style.display = "none";
f.SUB5.style.display = "none";
f.SUB6.style.display = "none";
f.SUB7.style.display = "none";
f.SUB8.style.display = "none";
f.SUB9.style.display = "none";
f.SUB10.style.display = "";
}
}
function goURL()
{
if(this.go.value != "default")
{
URL = this.go.value
window.open(URL,'_self','+ '+ '')
}
}
</script>
</head>
<body>
<table cellpadding="0" cellspacing="0" width="500" border="0">
<tr>
<td width="100">
<form name="select_machine">
<!--상위 셀렉트박스-->
<select name=" " onChange="showSub(this.options[this.selectedIndex].value);">
<option value="1">1990</option>
<option value="2">1991</option>
<option value="3">1992</option>
<option value="4">1993</option>
<option value="5">1994</option>
<option value="6">1995</option>
<option value="7">1996</option>
<option value="8">1997</option>
<option value="9">1998</option>
<option value="10">1999</option>
</select>
</td>
<td width="300">
<!--//여기부턴 하위셀렉트박스-->
<select name="SUB1" style="display:block;"onChange="return goURL()">
<option value="http://www.naver.com">제 1회 한국 중.고등학교 골프연맹회장배 </option>
<option value="http://www.naver.com">제 1회 스포츠조선-엘로드배 </option>
<option value="http://www.naver.com">제 1회 KGM-그린국제골프배 </option>
</select>
<select name="SUB2" style="display: none;"onChange="return goURL()">
<option value="">제 2회 한국 중.고등학교 골프연맹회장배 </option>
<option value="">제 2회 스포츠조선-엘로드배 </option>
<option value="">제 2회 KGM-그린국제골프배 </option>
</select>
<select name="SUB3" style="display: none;"onChange="return goURL()">
<option value=" ">제 3회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 3회 스포츠조선-엘로드배 </option>
<option value=" ">제 3회 KGM-그린국제골프배 </option>
</select>
<select name="SUB4" style="display:none;"onChange="return goURL()">
<option value=" ">제 4회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 4회 스포츠조선-엘로드배 </option>
<option value=" ">제 4회 KGM-그린국제골프배 </option>
</select>
<select name="SUB5" style="display: none;"onChange="return goURL()">
<option value=" ">제 5회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 5회 스포츠조선-엘로드배 </option>
<option value=" ">제 5회 KGM-그린국제골프배 </option>
<option value=" ">제 1회 파맥스배 </option>
</select>
<select name="SUB6" style="display: none;"onChange="return goURL()">
<option value=" ">제 6회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 6회 스포츠조선-엘로드배 </option>
<option value=" ">제 6회 KGM-그린국제골프배 </option>
<option value=" ">제 2회 파맥스배 회</option>
</select>
<select name="SUB7" style="display:none;"onChange="return goURL()">
<option value=" ">제 7회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 7회 스포츠조선-엘로드배 </option>
<option value=" ">제 7회 KGM-그린국제골프배 </option>
<option value=" ">제 3회 파맥스배 </option>
</select>
<select name="SUB8" style="display: none;"onChange="return goURL()">
<option value=" ">제 8회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 2회 스포츠조선-엘로드배 </option>
<option value=" ">제 2회 KGM-그린국제골프배 </option>
</select>
<select name="SUB9" style="display: none;"onChange="return goURL()">
<option value=" ">제 9회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 3회 스포츠조선-엘로드배 </option>
<option value=" ">제 3회 KGM-그린국제골프배 </option>
</select>
<select name="SUB10" style="display: none;"onChange="return goURL()">
<option value=" ">제 10회 한국 중.고등학교 골프연맹회장배 </option>
<option value=" ">제 3회 스포츠조선-엘로드배 </option>
<option value=" ">제 3회 KGM-그린국제골프배 </option>
</select>
</td>
<td width="100">
<input type = "button" value="이동" onclick="javascript:goURL()">
</td>
</tr>
</table>
</form>