[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건 3 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
775 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14243 0 01-03
774 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13912 0 01-12
773 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14851 0 01-14
772 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14469 0 01-17
771 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13499 0 01-18
770 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14587 0 01-21
769 이암쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14103 0 01-23
768 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13874 1 01-27
767 포인트쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15279 0 02-04
766 쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16589 0 02-08
765 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 16615 0 02-08
764 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12588 0 02-09
763 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15816 0 02-16
762 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13794 0 02-16
761 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15043 0 02-16
760 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 18049 0 02-22
759 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13397 1 02-27
758 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12365 0 02-27
757 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14377 0 02-27
756 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13868 0 02-29
755 쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14354 0 02-29
754 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 16064 0 03-04
753 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 13589 0 03-04
752 쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16127 0 03-06
751 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15653 0 03-21

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
7,706
어제
7,582
최대
8,233
전체
1,586,158
Copyright (c) 株式会社YHPLUS. All rights reserved.