검색부분수정했는데 검색이 안되요.

검색부분수정했는데 검색이 안되요.

QA

검색부분수정했는데 검색이 안되요.

본문

검색부분 디자인 수정했는데 검색이 안되는데 혹시 아시면 좀 알려주세요.

gumic.mireene.com

초짜입니다..이소스도 sir에 올리신 분거 보고 그대로 한건데요..ㅠㅠ

 

소스수정부분

 

수정전

css파일
#hd_sch {float:left;margin:0 0 0 20px;padding:0;border:1px solid #c3c6ca}
#hd_sch legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden}
#hd_sch #sch_stx {padding-left:5px;width:110px;height:24px;border:0;background:#fff;line-height:1.9em !important;line-height:1.6em}
#hd_sch #sch_submit {padding:0 5px;height:26px;border:0;background:#e2e6eb;color:#333;cursor:pointer}

 

 

head파일

<fieldset id="hd_sch">
            <legend>사이트 내 전체검색</legend>
            <form name="fsearchbox" method="get" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return fsearchbox_submit(this);">
            <input type="hidden" name="sfl" value="wr_subject||wr_content">
            <input type="hidden" name="sop" value="and">
            <label for="sch_stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
            <input type="text" name="stx" id="sch_stx" maxlength="20">
            <input type="submit" id="sch_submit" value="검색">
            </form>

            <script>
            function fsearchbox_submit(f)
            {
                if (f.stx.value.length < 2) {
                    alert("검색어는 두글자 이상 입력하십시오.");
                    f.stx.select();
                    f.stx.focus();
                    return false;
                }

                // 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
                var cnt = 0;
                for (var i=0; i<f.stx.value.length; i++) {
                    if (f.stx.value.charAt(i) == ' ')
                        cnt++;
                }

                if (cnt > 1) {
                    alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
                    f.stx.select();
                    f.stx.focus();
                    return false;
                }

                return true;
            }
            </script>
        </fieldset>

 

 

수정후-----------------------------------------------------------------------------

head수정

<div id="hd_sch"> 

             <input type="hidden" name="sfl" value="wr_subject||wr_content"> 

             <input type="hidden" name="sop" value="and"> 

                  <label for="sch_stc" id="sch_stc_label">검색어<strong class="sound_only"> 필수</strong></label> 

                  <input type="text" name="stx" value="" id="sch_stc" required > 

                  <button type="submit" id="sch_top" alt="검색"></button> 

              </form> 

             <script> 

             function fsearchbox_submit(f) 

             { 

                 if (f.stx.value.length < 2) { 

                     alert("검색어는 두글자 이상 입력하십시오."); 

                     f.stx.select(); 

                     f.stx.focus(); 

                     return false; 

                 } 

                 // 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요. 

                 var cnt = 0; 

                 for (var i=0; i<f.stx.value.length; i++) { 

                     if (f.stx.value.charAt(i) == ' ') 

                         cnt++; 

                 } 

                 if (cnt > 1) { 

                     alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다."); 

                     f.stx.select(); 

                     f.stx.focus(); 

                     return false; 

                 } 

                 return true; 

             } 

             $(function() { 

                 var $sch = $('#sch_stc');   //검색 input 

                 var $sch_label = $('#sch_stc_label');    //검색 label 

                 if ($sch.attr('value') == "") $sch_label.css('visibility','visible'); 

                 else  $sch_label.css('visibility','hidden'); 

                 $sch.focus(function() { 

                     $sch_label.css('visibility','hidden'); 

                 }); 

                 $sch.blur(function() { 

                     $this = $(this); 
                     if ($this.attr('id') == "sch_stc" && $this.attr('value') == "") $sch_label.css('visibility','visible'); 

                }); 

             }); 

             </script> 

        </div>

 

 

css 수정

#sch_stc{border:1px solid #c3c6ca;height:26px;width:198px;float:left;border-right:none;padding:0 15px;line-height:28px;color:#8b8b8b;font-size:1em;/*height:42px\9;*/ } 
#hd_sch form{position:relative;} 
#hd_sch label {position: absolute;top: 10px;left: 17px;color: #839298} 
#sch_top{width:35px;height:28px; background:url('../img2/top/s.jpg') no-repeat;border:0;float:left;}​

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 1

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT