[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 825건 5 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
725 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10811 0 11-09
724 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10813 0 02-06
723 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10823 0 07-01
722 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10827 0 12-27
721 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10837 0 08-12
720 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10850 0 10-30
719 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10863 0 04-23
718 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10864 0 10-15
717 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10868 0 02-20
716 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10887 0 09-03
715 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10891 0 05-17
714 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10919 0 04-27
713 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10934 0 04-26
712 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10950 0 04-24
711 띠떼쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10952 0 05-22
710 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10955 0 09-14
709 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10958 0 07-21
708 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10959 0 08-21
707 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10969 0 02-06
706 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10976 0 02-04
705 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10985 0 08-22
704 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 10995 0 08-15
703 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11049 0 07-02
702 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11056 0 08-07
701 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11090 0 09-29

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
3,272
어제
4,316
최대
7,259
전체
1,336,079
Copyright (c) 株式会社YHPLUS. All rights reserved.