[php] 2단 셀렉트 연동 > 팁앤테크

본문 바로가기
사이트 내 전체검색

팁앤테크

[php] 2단 셀렉트 연동

페이지 정보

본문

<script language="javascript">
window.onload = function() {
    document.getElementById("wr2_7").onchange = function() { getClass(this.form.wr2_7.options.selectedIndex) };
}

var classG = new Array(
    new Array("##선택##")
    <?php
    $sql = " select *
                from {$g5['menu_table']}
                where me_use = '1'
                  and length(me_code) = '2'
                order by me_order, me_id ";
    $result = sql_query($sql, false);

    for ($i=0; $row=sql_fetch_array($result); $i++) {
    ?>,new Array(
        <?php
        $sql2 = " select *
                    from {$g5['menu_table']}
                    where me_use = '1'
                      and length(me_code) = '4'
                      and substring(me_code, 1, 2) = '{$row['me_code']}'
                    order by me_order, me_id ";
        $result2 = sql_query($sql2);

        for ($k=0; $row2=sql_fetch_array($result2); $k++) {
            if($k==0) {
        ?>
            "<?php echo $row2[me_name]?>"
        <?php } else { ?>
            ,"<?php echo $row2[me_name]?>"
        <?php } ?>
        <?php
        }
        ?>)
    <?php } ?>
);

var temp, i=0, j=0;
var cselect;

function getClass(item) {
temp = document.getElementById("wr2_8");
subCnt = temp.options.length;
    for (i=(subCnt-1); i>0; i--) { temp.options[i] = null }
        for (var j=0; j<classG[item].length; j++) {
            cselect = classG[item][j];
            temp.options[j] = new Option(cselect, cselect)
        }
}

</script>


    <select name="wr2[7]" id="wr2_7">
        <option value="">선택해 주세요</option>
        <?php
        $sql = " select *
                    from {$g5['menu_table']}
                    where me_use = '1'
                      and length(me_code) = '2'
                    order by me_order, me_id ";
        $result = sql_query($sql, false);
   
        for ($i=0; $row=sql_fetch_array($result); $i++) {
        ?>
        <option value="<?php echo $row['me_name'] ?>"><?php echo $row['me_name'] ?></option>
        <?php } ?>
    </select>
    <select name="wr2[8]" id="wr2_8">
        <option value="">선택해 주세요</option>
    </select>
추천0

댓글목록

등록된 댓글이 없습니다.

Total 124건 2 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
99 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 18070 0 11-10
98 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 27803 0 01-15
97 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14180 0 05-02
열람중 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10727 0 12-05
95 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 20524 0 05-06
94 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15053 0 12-24
93 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 16717 0 03-20
92 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13660 0 03-18
91 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15513 0 11-11
90 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 27346 0 01-15
89 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12729 0 12-19
88 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11415 0 01-25
87 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 53655 0 07-10
86 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15550 0 12-24
85 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 22618 0 03-20
84 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 18711 0 11-29
83 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 17326 0 02-18
82 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 27724 0 02-09
81 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 18578 0 01-05
80 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11306 0 07-10
79 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 20136 0 09-21
78 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 18736 0 10-22
77 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 28227 0 03-20
76 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 23382 0 12-02
75 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15702 0 02-25

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
6,187
어제
7,612
최대
8,233
전체
1,623,372
Copyright (c) 株式会社YHPLUS. All rights reserved.