프로그래밍
유틸리티
기타자료
시험자료
유용한사이트
대화
여행
 
 
 
 프로그래밍(Programming)
 유틸리티(Utility)
 기타자료(ETC)
 시험자료(Exam)
 유용한사이트(Site)

 
 대화(Community)
 여행(Travel)

 
 회원가입
 로그인
 접속자 35

 
프로그래밍(Programming)

[HTML] 이중 select

페이지 정보

작성자 관리자 작성일16-08-23 13:29 조회4,033회 댓글0건



  • 이전글
  • 다음글
  • 목록

본문

<script language=JavaScript>
<!--

function sub_change1()
{
 vn_mnu1 = frm.menu1.selectedIndex;

 if ( vn_mnu1 == 1 )
 {
  frm.menu2.length = 3;
  frm.menu2.options[0].text =  '---두번째 항목---';
  frm.menu2.options[1].text =  '남';
  frm.menu2.options[2].text =  '여';
 }
 if ( vn_mnu1 == 2 )
 {
  frm.menu2.length = 7;
  frm.menu2.options[0].text =  '---두번째 항목---';
  frm.menu2.options[1].text =  '10대이하';
  frm.menu2.options[2].text =  '10대';
  frm.menu2.options[3].text =  '20대';
  frm.menu2.options[4].text =  '30대';
  frm.menu2.options[5].text =  '40대';
  frm.menu2.options[6].text =  '50대이상';
 }
 if ( vn_mnu1 == 3 )
 {
  frm.menu2.length = 16;
  frm.menu2.options[0].text =  '---두번째 항목---';
  frm.menu2.options[1].text =  '강원도';
  frm.menu2.options[2].text =  '경기도';
  frm.menu2.options[3].text =  '경상남도';
  frm.menu2.options[4].text =  '경상북도';
  frm.menu2.options[5].text =  '광주광역시';
  frm.menu2.options[7].text =  '대구광역시';
  frm.menu2.options[8].text =  '부산광역시';
  frm.menu2.options[9].text =  '서울특별시';
  frm.menu2.options[10].text =  '울산광역시';
  frm.menu2.options[11].text =  '전라남도';
  frm.menu2.options[12].text =  '전라북도';
  frm.menu2.options[13].text =  '제주도';
  frm.menu2.options[14].text =  '충청남도';
  frm.menu2.options[15].text =  '충청북도';
 }
 if ( vn_mnu1 == 4 )
 {
  frm.menu2.length = 6;
  frm.menu2.options[0].text =  '---두번째 항목---';
  frm.menu2.options[1].text =  '기독교';
  frm.menu2.options[2].text =  '불교';
  frm.menu2.options[3].text =  '천주교';
  frm.menu2.options[4].text =  '기타';
  frm.menu2.options[5].text =  '무교';
 }
}

-->
</script>

<html>
<head>
</head>
<body>
<form name="frm">

<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
 <td> 
  <select name="menu1" size="1" onChange="sub_change1()">
  <option selected>---첫번째 항목---</option>
  <option>성  별</option>
  <option>연령별</option>
  <option>지역별</option>
  <option>종교별</option>
  </select>

  <select name="menu2" size="1" onChange="sub_change2()">
  <option value=" " selected>---두번째 항목---</option>
  </select>
 </td>
</tr>
</table>

</form>
</body>
</html>

출처 : http://m.blog.naver.com/adv00/90046012625

댓글목록

등록된 댓글이 없습니다.

  • 이전글
  • 다음글
  • 목록
 

 
코스트프리소개
제휴안내
이용약관
개인정보 취급방침
이메일주소 무단수집거부
Copyright ⓒ 2009-2015 Costfree.co.kr All Rights Reserved.
오늘 1,653    어제 1,621    최대 2,939    전체 904,230