[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건 1 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
825 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 56737 0 06-29
824 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 53156 0 06-02
823 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 52011 0 07-10
822 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 51938 0 07-29
821 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 51527 0 04-07
820 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 51454 0 06-29
819 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 51307 0 07-28
818 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 51236 0 07-02
817 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 49901 0 05-12
816 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 49857 0 04-20
815 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 49540 0 04-09
814 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 47554 0 03-30
813 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 46780 0 09-23
812 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 45876 0 09-27
811 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 43639 0 11-07
810 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 42858 0 11-19
809 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 41396 0 08-06
808 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 40933 0 03-04
807 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 40571 0 08-06
806 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 38401 0 10-13
805 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 38333 0 07-13
804 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 37870 0 09-19
803 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 37094 0 10-04
802 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 37007 0 11-29
801 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 36999 0 07-22

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
4,323
어제
5,299
최대
7,259
전체
1,269,144
Copyright (c) 株式会社YHPLUS. All rights reserved.