http://reedyfox.com/bbs/zboard.php?id=qna&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=151http://miniwini.com/miniwinis/board/index.php?bid=qna&mode=read&id=3555&m=search&s=4&k=sunny&p=1&sp=&op=AND<!-- 폼 앞에 들어갈 내용 -->
<? $sn = "off"; $ss = "on"; $sc = "off"; ?>

<script language="javascript">
function
zbSearchSelectOption(key) {    
search.sn.value = 'off';    
search.ss.value = 'off';    
search.sc.value = 'off';    
search[key].value = 'on';
}
</script>

<!-- 변경할 내용 -->
<select onChange="zbSearchSelectOption(this.options[this.selectedIndex].value);">
<option value="sn" <?=($sn=="on"?"selected":"")?>>이름</option>
<option value="ss" <?=($ss=="on"?"selected":"")?>>제목</option>
<option value="sc" <?=($sc=="on"?"selected":"")?>>내용</option>
</select>

[전체 소스]

<? $sn = "off"; $ss = "on"; $sc = "off"; ?>
<script language="javascript">
function zbSearchSelectOption(key) {    
search.sn.value = 'off';    
search.ss.value = 'off';    
search.sc.value = 'off';    
search[key].value = 'on';
}
</script>

<!-- 폼태그 부분;; 수정하지 않는 것이 좋습니다 -->
<form method=get name=search action=<?=$PHP_SELF?>>
<input type=hidden name=page value=<?=$page?>>
<input type=hidden name=id value=<?=$id?>>
<input type=hidden name=select_arrange value=<?=$select_arrange?>>
<input type=hidden name=desc value=<?=$desc?>>
<input type=hidden name=page_num value=<?=$page_num?>>
<input type=hidden name=selected>
<input type=hidden name=exec>
<input type=hidden name=sn value=<?=$sn?>>
<input type=hidden name=ss value=<?=$ss?>>
<input type=hidden name=sc value=<?=$sc?>>
<input type=hidden name=category value="<?=$category?>">

<select onChange="zbSearchSelectOption(this.options[this.selectedIndex].value);">
<option value="sn" <?=($sn=="on"?"selected":"")?>>이름</option>
<option value="ss" <?=($ss=="on"?"selected":"")?>>제목</option>
<option value="sc" <?=($sc=="on"?"selected":"")?>>내용</option>
</select>

<input type=text name=keyword value="<?=$keyord?>" class=input size=10>
<input type=submit class=submit value="검색">
<input type=button class=button value="취소" onclick=location.href="zboard.php?id=<?=$id?>">
</form>


써니님, 리디님. 엽우님께서 도와주셨습니다
감사합니다 ^^;;

 
댓글은 로그인 사용자만 작성 가능합니다. 로그인하기