T

게시판관리 그룹아이디 자동입력 기능

게시판관리에서 검색시 셀렉트 박스 그룹 아이디 선택시 그룹아이디가 기억안날때가 많은대요..
그부분을 셀렉트 박스로 처리하여 선택시 자동 입력 할수있게 바꿔봤습니다.

adm/board_list.php 파일

html 부분

<!-- 수정전 -->
<form name=fsearch method=get>
<tr>
    <td width=50% align=left><?=$listall?> (게시판수 : <?=number_format($total_count)?>개)</td>
    <td width=50% align=right>
        <select name=sfl>
            <option value='bo_table'>TABLE</option>
            <option value='bo_subject'>제목</option>
            <option value='a.gr_id'>그룹ID</option>
        </select>
        <input type=text name=stx required itemname='검색어' value='<?=$stx?>'>
        <input type=image src='<?=$g4[admin_path]?>/img/btn_search.gif' align=absmiddle></td>
</tr>
</form>

<!-- 수정후 -->
<form name=fsearch method=get>
<tr>
    <td width=50% align=left><?=$listall?> (게시판수 : <?=number_format($total_count)?>개)</td>
    <td width=50% align=right>
        <select name=sfl onchange="gr_select_visibility(this.value);">
            <option value='bo_table'>TABLE</option>
            <option value='bo_subject'>제목</option>
            <option value='a.gr_id'>그룹ID</option>
        </select>
  <?=get_group_select("sca",$sca," id=\"sca\" onchange=\"gr_input_get(this.value);\"");?>
        <input type=text id=stx name=stx required itemname='검색어' value='<?=$stx?>'>
        <input type=image src='<?=$g4[admin_path]?>/img/btn_search.gif' align=absmiddle></td>
</tr>
</form>




하단 scr-->ipt 부분

// 수정전

function board_copy(bo_table) {
    window.open("./board_copy.php?bo_table="+bo_table, "BoardCopy", "left=10,top=10,width=500,height=200");
}

// 수정후

if(document.getElementById('sfl').value != "a.gr_id"){
 document.getElementById('sca').disabled = "disabled";
}
function gr_select_visibility(v){
 if(v == "a.gr_id"){
  document.getElementById('sca').disabled = "";
  document.getElementById('stx').value = document.getElementById('sca').options[0].value;
  document.getElementById('sca').options[0].selected = true;
 }else{
  document.getElementById('sca').disabled = "disabled";
  document.getElementById('stx').value = "";
 }
}
function gr_input_get(v){
 document.getElementById('stx').value = v;
}
function board_copy(bo_table) {
    window.open("./board_copy.php?bo_table="+bo_table, "BoardCopy", "left=10,top=10,width=500,height=200");
}

|

댓글 1개

좋은 팁이네요 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 9,777
17년 전 조회 3,312
17년 전 조회 4,043
17년 전 조회 3,245
17년 전 조회 3,577
17년 전 조회 1,879
17년 전 조회 3,438
17년 전 조회 3,338
17년 전 조회 7,448
17년 전 조회 2,705
17년 전 조회 5,570
17년 전 조회 3,941
17년 전 조회 2,633
17년 전 조회 3,945
17년 전 조회 4,129
17년 전 조회 5,817
17년 전 조회 2,856
17년 전 조회 3,990
17년 전 조회 3,122
17년 전 조회 3,543