테스트 사이트 - 개발 중인 베타 버전입니다

글작성 페이지에서 g5_board 테이블로 값이 들어갈 수 있게 할 수 있나요 채택완료

글쓰기 페이지에서 사용여부에 따라

 

사용시 - 상하

미사용시-좌우

 

이런 식으로 나오는 에디터가 다르게 분기를 주고싶습니다.

분기 자체는 제대로 들어가고 그에 따라 폼이 달라지지만 분기적용 후 글 수정을 하면 수정이 되지 않습니다. 이상한 건 분기를 없애고 나면 수정도 멀쩡하게 된다는 것입니다.

어디가 문제일까요?

 

 

 

</p>

<p><tr></p>

<p>            <th scope="row"><label for="wr_12">사용여부<strong class="sound_only">필수</strong></label></th></p>

<p>            <td></p>

<p> </p>

<p>                <input type="radio" name="wr_12" value="on" id="frm_use_on" required checked <?php if ($write['wr_12'] == 'on') echo 'checked' ?>><label for="frm_use_on">사용   </label></p>

<p>                <input type="radio" name="wr_12" value="off" id="frm_use_off" required <?php if ($write['wr_12'] == 'off') echo 'checked' ?>><label for="frm_use_off">사용 안함</label></p>

<p> </p>

<p>            </td></p>

<p>        </tr></p>

<p>

 </p>

<p>        <?php }?></p>

<p> </p>

<p>        <tr></p>

<p>            <th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th></p>

<p>            <td><input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required"></td></p>

<p>        </tr></p>

<p>        <tr><th colspan="2">신청 폼 사용 여부에 따라 상/하단 폼과 좌/우단 폼이 노출됩니다.</th></tr></p>

<p>        <?php if($write['wr_12']=='on'){?></p>

<p>            <tr></p>

<p>                <th scope="row"><label for="wr_11">상단</label></th></p>

<p>                <td class="wr_content"></p>

<p>                    <?php echo editor_html("wr_11", $write['wr_11'], $is_dhtml_editor); ?></p>

<p>                </td></p>

<p>            </tr></p>

<p> </p>

<p>            <tr></p>

<p>                <th scope="row"><label for="wr_7">하단</label></th></p>

<p>                <td class="wr_content"></p>

<p>                    <?php echo editor_html("wr_7", $write['wr_7'], $is_dhtml_editor); ?></p>

<p>                </td></p>

<p>            </tr></p>

<p>        <?php }else{ ?></p>

<p>            <tr></p>

<p>                <th scope="row"><label for="wr_13">좌단</label></th></p>

<p>                <td class="wr_content"></p>

<p>                    <?php echo editor_html("wr_13", $write['wr_13'], $is_dhtml_editor); ?></p>

<p>                </td></p>

<p>            </tr></p>

<p> </p>

<p>            <tr></p>

<p>                <th scope="row"><label for="wr_14">우단</label></th></p>

<p>                <td class="wr_content"></p>

<p>                    <?php echo editor_html("wr_14", $write['wr_14'], $is_dhtml_editor); ?></p>

<p>                </td></p>

<p>            </tr></p>

<p>        <?php } ?></p>

<p> </p>

<p>

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

wr_12 는 글 작성이 완료되어야만 데이터가 업데이트 될텐데, 작성중에 wr_12 값을 가져올 수가 없어서 else 구문안에 있는 wr_13, wr_14 만 출력될 것 같은데요....?? 글 작성시 wr_12 를 체크한채로 작성한 후 수정하면 그제서야 wr_13, wr_14 는 안보일거고 wr_11, wr_7 이 뜰 것 같네요

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

스크립트 change 이벤트로 체크된 wr_12 값에 따라 on 일 경우 상/하 에디터 보이기, off 일 경우 좌/우 에디터 보이기 이런식으로 구현해야하지 않나 싶어요
감사합니다
이벤트로 처리하면 되는건데 괜히 고집부리고 있었네요

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인

전체 질문 목록