댓글 수정시 입력내용 보이기

댓글 수정시 입력내용 보이기

QA

댓글 수정시 입력내용 보이기

본문

https://sir.kr/g5_skin/15658?sfl=wr_subject&stx=%EB%8C%93%EA%B8%80&page=2

 

위의 스킨을 사용중인데요.

댓글을 통해 신청을 하고나서, [수정]을 누르면 기존 작성내용이 사라지고, 

모든 입력란이 공란으로 표시됩니다.

다시 작성하고, 적용하면 새 댓글로 등록되지 않고, 기존 신청내용이 갱신(수정)이 되기는 하는데요.

[수정]선택시 기존 입력값을 불러오게 하려면 어떻게 수정을 해야 할까요?

 

참고로 해당스킨의 댓글출력과 댓글쓰기 부분의 소스는 아래와 같습니다.

 

# 댓글출력 및 쓰기 부분 소스 

......
<!-- 댓글 출력 -->
<table id="comment_table" class="w3-table-all notranslate">
    <?php if (strstr($list[$i]['wr_option'], "secret")) { ?><img
        src="<?php echo $board_skin_url; ?>/img/icon_secret.gif" alt="비밀글"><?php } ?>
    <?php //echo $comment ?>
    <tr>
        <th>이름</th>
        <td><?=$list[$i]['wr_1']?></td>
    </tr>
    <tr>
        <th>성별</th>
        <td><?=$list[$i]['wr_2']?></td>
    </tr>
                <?php if($bo_table == "program02"){ ?>
                <tr>
        <th>소속</th>
        <td><?=$list[$i]['wr_3']?></td>
    </tr>        
                <?php }else{?>
                <tr>
        <th>학교</th>
        <td><?=$list[$i]['wr_3']?></td>
    </tr>
                <?php } ?>
    
    <tr>
        <th>주소</th>
        <td><?=$list[$i]['wr_4']?></td>
    </tr>
    <tr>
        <th>연락처</th>
        <td><?=$list[$i]['wr_5']?></td>
    </tr>
    <tr>
        <th>이메일</th>
        <td><?=$list[$i]['wr_6']?></td>
    </tr>
                
</table>
            <?php if($list[$i]['wr_9']){ ?>
                <div style="margin-top:30px;padding:10px ;">
                    <div style="padding:10px;color:#523176"><b>· 프로그램 접수 진행현황</b></div>
                    <div style="padding:20px;"><?=$list[$i]['wr_9']?></div>
                </div>
            <?php } ?>

<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
            <span id="reply_<?php echo $comment_id ?>"></span><!-- 답변 -->
            
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>"
       id="secret_comment_<?php echo $comment_id ?>">
<textarea id="save_comment_<?php echo $comment_id ?>"
          style="display:none"><?php echo get_text($list[$i]['content1'], 0) ?></textarea>

<?php if ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
    $query_string = str_replace("&", "&", $_SERVER['QUERY_STRING']);

    if ($w == 'cu') {
        $sql = " select wr_id, wr_content from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
        $cmt = sql_fetch($sql);
        $c_wr_content = $cmt['wr_content'];
    }

    $c_reply_href = './board.php?' . $query_string . '&c_id=' . $comment_id . '&w=c#bo_vc_w';
    $c_edit_href = './board.php?' . $query_string . '&c_id=' . $comment_id . '&w=cu#bo_vc_w';
    ?>
    <footer>
        <ul class="bo_vc_act">
<?php if ($list[$i]['is_reply']) {
                                    
                            ?>
    <!-- <li><a href="<?php echo $c_reply_href; ?>"
           onclick="comment_box('<?php echo $comment_id ?>', 'c'); return false;">답변</a>
    </li> -->
                            
                            <?php 
                            } 
                        ?>
<?php if ($list[$i]['is_edit']) { ?>
    <li style="padding-top:3px;"><a  href="<?php echo $c_edit_href; ?>"
           onclick="comment_box('<?php echo $comment_id ?>', 'cu'); return false;">수정</a>
    </li><?php } ?>
<?php if ($list[$i]['is_del']) { ?>
    <li style="padding-top:3px;"><a href="<?php echo $list[$i]['del_link']; ?>" onclick="return comment_delete();">삭제</a>
    </li><?php } ?>
        </ul>
    </footer>
<?php } ?>
        </article>
    <?php } ?>
    <?php if ($i == 0) { //댓글이 없다면 ?><p id="bo_vc_empty">등록된 댓글이 없습니다.</p><?php } ?>

</section>
<?php }?>
<!-- } 댓글 끝 -->

<?php if ($is_comment_write) {
    if ($w == '')
        $w = 'c';
    ?>
    <!-- 댓글 쓰기 시작 { -->
    <aside id="bo_vc_w">
        <h2>댓글쓰기</h2>

        <form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);"
  method="post" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="comment_id" value="<?php echo $c_id ?>" id="comment_id">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="is_good" value="">

<div class="tbl_frm01 tbl_wrap">
    <table>
        <tbody>
        <?php if ($is_guest) { ?>
<input type="hidden" name="wr_name" id="wr_name" value="Guest">
<!--<tr>-->
<!--    <th scope="row"><label for="wr_name">이름<strong class="sound_only"> 필수</strong></label></th>-->
<!--    <td><input type="text" name="wr_name" value="--><?php //echo get_cookie("ck_sns_name"); ?><!--"-->
<!--   id="wr_name" required class="frm_input required" size="5" maxLength="20"></td>-->
<!--</tr>-->
<tr>
    <th scope="row"><label for="wr_password">비밀번호<strong class="sound_only"> 필수</strong></label>
    </th>
    <td><input type="password" name="wr_password" id="wr_password" required
   class="frm_input required" size="10" maxLength="20"></td>
</tr>
        <?php } ?>
        <tr>
<th scope="row"><label for="wr_secret">비밀글사용</label></th>
<td><input type="checkbox" name="wr_secret" value="secret" id="wr_secret" checked disabled></td>

        </tr>
        <?php if ($is_guest) { ?>
<tr>
    <th scope="row">자동등록방지</th>
    <td><?php echo $captcha_html; ?></td>
</tr>
        <?php } ?>
        <?php
        if ($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) {
?>
<tr>
    <th scope="row">SNS 동시등록</th>
    <td id="bo_vc_send_sns"></td>
</tr>
<?php
        }
        ?>

        <input type="hidden" name="wr_content" id="wr_content" value="hidden"></input>

        <tr>
<th scope="row">이름</th>
<td>
    <input type="text" id="wr_1" name="wr_1" maxlength="20" required class="required frm_input"
           title="이름">
</td>
        </tr>
        <tr>
<th scope="row">성별</th>
<td>
    <input type="text" id="wr_2" name="wr_2" maxlength="20" required class="required frm_input"
           title="성별" size="10">
</td>
        </tr>
                    <?php if($bo_table == "program02"){ ?>
                    <tr>
<th scope="row">소속</th>
<td>
    <input type="text" id="wr_3" name="wr_3" maxlength="20" required class="required frm_input"
           title="소속" size="30">
</td>
        </tr>
                    <?php }else{ ?>
                    <tr>
<th scope="row">학교</th>
<td>
    <input type="text" id="wr_3" name="wr_3" maxlength="20" required class="required frm_input"
           title="학교" size="30">
</td>
        </tr>
                    <?php }?>
        
        <tr>
<th scope="row">주소</th>
<td>
    <input type="text" id="wr_4" name="wr_4" maxlength="50" required class="required frm_input"
           title="주소" size="70">
</td>
        </tr>
        <tr>
<th scope="row">연락처</th>
<td>
    <input type="text" id="wr_5" name="wr_5" maxlength="13" required class="required frm_input"
           title="연락처">
</td>
        </tr>
        <tr>
<th scope="row">이메일</th>
<td>
    <input type="text" id="wr_6" name="wr_6" maxlength="50" required class="required frm_input"
           title="이메일">
</td>
        </tr>

        </tbody>
    </table>
</div>

<div class="btn_confirm">
    <input type="submit" id="btn_submit" class="btn_submit" value="프로그램 신청">
</div>

        </form>
    </aside>

......

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 687
QA 내용 검색

회원로그인

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