확인 버튼 코드를 이렇게 수정 해보았는데.. 왜$wr_id 에러가 날까요?
본문
$wr_id를 사용하지 않습니다 라는 에러코드가 나타납니다.
<!--원래 확인 버튼-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" valign="top" style="padding-top:30px;">
<input type=image id="btn_submit" src="<?=$board_skin_path?>/img/btn_write.gif" border=0 accesskey='s'>
<a href="./board.php?bo_table=<?=$bo_table?>"><img id="btn_list" src="<?=$board_skin_path?>/img/btn_list.gif" border=0></a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" valign="top" style="padding-top:30px;">
<input type="submit" id="btn_submit" value="확인및 신청" border=0 accesskey='s'>
<? if($is_admin) { ?>
<input type="button" value="관리자 목록" onClick="jumpit1()">
<? }?>
<input type="button" value="목록" onClick="jumpit2()">
</td>
</tr>
</table>
위와 같은 코드가 원래 확인 버튼이 있으면..
에러가 나지 않습니다.
근데.. .
아래의 원래 확인버튼부분을 주석 처리 해버리면 에러가 난답니다.
왜그럴까요???
<!--원래 확인 버튼
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" valign="top" style="padding-top:30px;">
<input type=image id="btn_submit" src="<?=$board_skin_path?>/img/btn_write.gif" border=0 accesskey='s'>
<a href="./board.php?bo_table=<?=$bo_table?>"><img id="btn_list" src="<?=$board_skin_path?>/img/btn_list.gif" border=0></a></td>
</tr>
</table> -->
<!-- 내가 만든 확인 버튼 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" valign="top" style="padding-top:30px;">
<input type="submit" id="btn_submit" value="확인및 신청" border=0 accesskey='s'>
<? if($is_admin) { ?>
<input type="button" value="관리자 목록" onClick="jumpit1()">
<? }?>
<input type="button" value="목록" onClick="jumpit2()">
</td>
</tr>
</table>
그리고 폼문 밖에..
<script>
function jumpit1(){
window.location="./board.php?bo_table=<?=$bo_table?>"
return false
}
function jumpit2(){
window.location="./board.php?bo_table=<?=$bo_table?>&stx=010"
return false
}
</script>
가 있습니다.
!-->!-->!-->답변 3
자바스크립트 에러입니다.
에러의 원인은
a 태그의 img 태그에 ID가 id="btn_list" 이런식으로 있고,
하단의 자바스크립트 부분에 document.getElementById('btn_list').disabled = true;
이런 스크립트가 있는데, a태그를 모두 삭제함으로 인해 자바스크립트만 남게 되어 에러가 발생한 겁니다.
그러므로, 삭제 또는 주석처리하셔서
<a href="./board.php?bo_table=<?=$bo_table?>"
><img id=
"btn_list"
src=
"<?=$board_skin_path?>/img/btn_list.gif"
border=0></a>
이 부분이 없는 것이라면
하단의 자바스크립트 부분에도
document.getElementById('btn_list').disabled = true;
이 스크립트를 없애거나 주석처리 해야 에러를 해결할 수 있습니다.
input --> button 으로 바꿔서 해보세요..
그리고 input submit 는 form 으로 전송 해야 합니다.
확인 버튼 테이블에서..
다음과 같이..
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" valign="top" style="padding-top:10px;">
<input type="submit" id="btn_submit" value="글 저장" border=0 accesskey='s'>
<a href="./board.php?bo_table=<?=$bo_table?>"><img id="btn_list" src="<?=$board_skin_path?>/img/btn_list.gif" border=0></a>
<? if($is_admin) { ?>
<input type="button" value="관리자 목록" onClick="jumpit1()">
<? }?>
<input type="button" value="목록" onClick="jumpit2()">
</td>
</tr>
</table>
</td></tr></table>
</form>
에서
<a href="./board.php?bo_table=<?=$bo_table?>"><img id="btn_list" src="<?=$board_skin_path?>/img/btn_list.gif" border=0></a>
만 삭제를 하면 wr_id에러가 발생을 하네요..
왜 그런걸까요...?
/bbs/write.php에서 이코드와 관련된 문제가 있을까요???
!-->!-->