개발

[javascript] 검색

지승준 2014. 10. 1. 09:47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//자바스크립트 검색
function find_doctor( form ){
    
    var doctor_name = form.doctor_name.value;    
    $(".right_con em").each(function( idx, dc_em ){
        var txt = $( dc_em ).text();
        if( txt.indexOf( doctor_name ) == -1 ){            
            $( dc_em ).parent().parent().parent().css( "display""none" );            
        }else{            
            $( dc_em ).parent().parent().parent().css( "display""" );            
        }        
    });    
    return false;    
}
cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<form name="find_form" onsubmit="return find_doctor(this);">
    <table cellspacing="0" cellpadding="0" border="0" summary="1열은 단락제목을 2열은 내용기입을 나타낸다.">
        <caption>시간 선택 폼</caption>
        <colgroup>
            <col width="77px">
            <col width="225px">
        </colgroup>
 
        <tbody>
            <tr>
                <th>검색</th>
                <td>
                    <label for="sear_txt" class="skip">검색 기입란</label>
                    <input id="sear_txt" style="width:177px;" type="text" name="doctor_name" class="choice">
                    <input type="image" alt="검색버튼" title="검색버튼" src="../images/sub/new_time_choice_btn.gif">
                </td>
            </tr>
        </tbody>
    </table>
</form>
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
<li id="YRH101">
    <a href='javascript:get_doctor_date( "YRH101", "N", "임시_진료", "", "" );'>
        <strong class="left_img">
            <img src="../images/sub/pop_blank_man.jpg" alt="이미지 미등록" style="width: 102px;height: 129px;">
        </strong>
        <strong class="right_con">
            <em>임시_진료</em>    
            <span>진료과 : </span>
            <span>직급/직위 : 입력없음</span>
            <span class="mgb_x">전문분야 : </span>
        </strong>
    </a>
</li>
cs