체크박스 입력값 유지하는 법 (list.php에서)
목록에서 특정필드를 숨기는 체크박스를 적용했습니다.
체크하면 사라지고 다시 체크하면 보이는 형태인데
글을 클릭해서 들어가거나 새로고침을 하면 체크가 풀립니다.
db에 값이 안 넘어가서 그런 거 같은데 초보라 여기저기 찾아보고 헤매다가 여쭙습니다 ㅜㅜ
어떻게 해야 체크가 안 풀릴 수 있을까요?
</p><p><script type="text/javascript">
window.onload = function(){
document.getElementById('wr_9').onclick = function(){
var o = document.getElementById('hide');
if(this.checked){
o.style.display = 'none';
} else {
o.style.display = '';
}
}
}
</script> </p><p>
</p><p><div>
<table>
<tr>
<td colspan="2">
<input type="checkbox" name="wr_9" id="wr_9" value="체크" <?php if( $write['wr_9'] == "체크" ) { echo "checked=true";}?>> 숨기기 체크
</td>
</tr>
</table>
</div></p><p>
</p><p><div class="field" id="hide"></p><p> 체크하면 사라지고 보이는 내용</p><p></div></p><p>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
답변대기
채택
채택
답변대기
채택
답변대기
답변대기
채택
채택
답변대기
답변대기
채택
채택
답변대기
채택
답변대기
채택
답변대기
채택
제가 배우고 있는 입장이라 차근차근 알려주시면 감사합니다 ㅜㅜ