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

글쓰기 개인정보동의 ??? 채택완료

연탄집개 4년 전 조회 2,295

아래링크를 참고해서 만들었는데.

https://gnustudy.com/bbs/board.php?bo_table=skin_board&wr_id=136

 

write.skin.php에 아래처럼 처리 했는데 .

동작을 못하네요 무엇이 문제 일까요? 

 

내용을 이렇게 해주도 

 

</strong> <div style="margin:5px 0 0;text-align:right">

        <label for="wr_10">개인정보수집이용에 동의합니다.</label>

        <input type="checkbox" name="wr_10" value="1"<?php echo ($write['wr_10'] == "1") ? " checked" : "";?>>

    </div></p>

<p><strong>

 

스크립트 

 

</strong>

    function fwrite_submit(f)

    {

        if (!f.wr_10.checked) {

        alert("개인정보수집이용에 동의하셔야 작성할 수 있습니다.");

        f.wr_10.focus();

        return false;</p>

<p> </p>

<p><strong>

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

답변 4개

채택된 답변
+20 포인트
j
4년 전

스크립트는. "/ } 등 하나라도 빠지면 작동되지 않습니다.

 

스크립트 구문 닫기  } 해주세요.

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

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

 

</strong></p>

<p><section id="bo_w">

    <h2 class="sound_only"><?php echo $g5['title'] ?></h2></p>

<p>    <!-- 게시물 작성/수정 시작 { -->

    <script>

function fwrite_submit(f)

{

if (!f.wr_10.checked) {

alert("개인정보수집이용에 동의하셔야 작성할 수 있습니다.");

f.wr_10.focus();

return false;

}</p>

<p></script>

    <form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?php echo $width; ?>">

    <input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">

    <input type="hidden" name="w" value="<?php echo $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="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="sst" value="<?php echo $sst ?>">

    <input type="hidden" name="sod" value="<?php echo $sod ?>">

    <input type="hidden" name="page" value="<?php echo $page ?>">

    <input type="hidden" name="wr_password" value="asdf13579~!@">

    <input type="hidden" name="wr_5" value="210만">

    <input type="hidden" name="wr_subject" value="CCTV 가입"></p>

<p>        <div class="nib">

           

    

   <div class="out_pad">

                <p class="title">개인정보활용동의</p>

                 

                <!--<a class="title_a weight_m" href="#">지난이용약관 보기 </a>-->

                <div>

                약관 내용

                </div>

                <!--join_form-->

    

            <div style="margin:5px 0 0;text-align:right">

        <label for="wr_10">개인정보수집이용에 동의합니다.</label>

        <input type="checkbox" name="wr_10" value="1"<?php echo ($write['wr_10'] == "1") ? " checked" : "";?>>

    </div>

                

            </div></p>

<p>    

            <div class="sub_padding">

                <div class="table_frame table_frame_two">

                    <table class="product_agree01">

                     

                        <tbody>

                            

                                                  

                            <tr>

                                <th>신청자명</th>

                                <td><input name="wr_name" id="wr_name" type="text" class="inp_txt w_122 required" size="4" maxlength="100" value="<?php echo $name ?>" checked="checked" required>

                                </td>

                            </tr></p>

<p>

                            <tr>

                                <th>전화번호</th>

                                <td><input name="wr_1" id="wr_1" type="text" class="inp_txt w_122 required" size="4" maxlength="100" value="<?php echo $write['wr_1'] ?>" onblur="ChkNumberOnly(this);" required>

                                </td>

                            </tr></p>

<p>     

    </p>

<p>                       </p>

<p>

                            <tr>

                                <th>주 소</th>

                                <td>

                                    <label for="ex_zip" class="sound_only">우편번호</label>

                                    <input type="text" name="ex_zip" value="<?php echo $ex_zip; ?>" id="ex_zip"  class="frm_input required" size="6" maxlength="6">

                                    <button type="button" class="btn_frmline" onclick="win_zip('fwrite', 'ex_zip', 'ex_addr1', 'ex_addr2', 'ex_addr3', 'ex_jibeon');">주소 검색</button>


                                    <input type="text" name="ex_addr1" value="<?php echo $ex_addr1; ?>" id="ex_addr1" class="frm_input frm_address required" size="50">

                                    <label for="ex_addr1">기본주소</label>


                                    <input type="text" name="ex_addr2" value="<?php echo $ex_addr2; ?>" id="ex_addr2" class="frm_input frm_address required" size="50">

                                    <label for="ex_addr2">상세주소</label>


                                    <input type="text" name="ex_addr3" value="<?php echo $ex_addr3; ?>" id="ex_addr3" class="frm_input frm_address required" size="50" readonly="readonly">

                                    <label for="ex_addr3">참고항목</label>

                                    <input type="hidden" name="ex_jibeon" value="<?php echo $ex_jibeon; ?>">

                                </td>

                            </tr></p>

<p>

                             <tr>

                                <th>카메라</th>

                                <td>실내: <input name="wr_3" id="wr_3" type="number" class="inp_txt w_122" size="2" maxlength="2" value="<?php echo $write['wr_3'] ?>" onblur="ChkNumberOnly(this);" required>

                                    실외: <input name="wr_4" id="wr_4" type="number" class="inp_txt w_122" size="2" maxlength="2" value="<?php echo $write['wr_4'] ?>" onblur="ChkNumberOnly(this);" required></p>

<p>                                </td>

                            </tr></p>

<p>

                            <tr>

                                <th>카메라 화소</th><!-- wr_5 -->

                                <td>210만 화소</p>

<p>                                </td>

                            </tr>

                            

                        <tr>

                             <th>용량</th>

                               

                               <td>

                               <select name='wr_6' required itemname="용량">

                                   <option value=''>선택하세요</option>

                                   <option value='1TB' <?php if($write[wr_6] == '1TB') echo " selected "; ?>>1TB</option>

                                   <option value='2TB' <?php if($write[wr_6] == '2TB') echo " selected "; ?>>2TB</option>

                                   <option value='4TB' <?php if($write[wr_6] == '4TB') echo " selected "; ?>>4TB</option>

                                </select>                                  

                                </td>

                            </tr></p>

<p>                        <tr>

                             <th>모니터</th>

                               

                               <td>

                               <select name='wr_7' required itemname="모니터">

                                   <option value=''>선택하세요</option>

                                   <option value='미지급' <?php if($write[wr_7] == '미지급') echo " selected "; ?>>미지급</option>

                                   <option value='지급' <?php if($write[wr_7] == '지급') echo " selected "; ?>>지급</option>

                                </select>                                  

                                </td>

                            </tr></p>

<p>

                            <tr>

                             <th>원격모니터링</th>

                               

                               <td>

                               <select name='wr_8' required itemname="원격모니터링">

                                   <option value=''>선택하세요</option>

                                   <option value='사용안함' <?php if($write[wr_8] == '사용안함') echo " selected "; ?>>사용안함</option>

                                   <option value='사용' <?php if($write[wr_8] == '사용') echo " selected "; ?>>사용</option>

                                </select>                                  

                                </td>

                            </tr></p>

<p>                            <tr>

                                <th>참고사항</th>

                                <td>

                                     <div class="wr_content <?php echo $is_dhtml_editor ? $config['cf_editor'] : ''; ?>">

                                        <?php if($write_min || $write_max) { ?>

                                        <!-- 최소/최대 글자 수 사용 시 -->

                                        <p id="char_count_desc">이 게시판은 최소 <strong><?php echo $write_min; ?></strong>글자 이상, 최대 <strong><?php echo $write_max; ?></strong>글자 이하까지 글을 쓰실 수 있습니다.</p>

                                        <?php } ?>

                                        <?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?>

                                        <?php if($write_min || $write_max) { ?>

                                        <!-- 최소/최대 글자 수 사용 시 -->

                                        <div id="char_count_wrap"><span id="char_count"></span>글자</div>

                                        <?php } ?>

                                    </div>

        </p>

<p>

                                </td>

                            </tr>

                            </p>

<p>

                            

    

       </p>

<p>

                          

                         

                        </tbody>

                    </table>

    

                </div>

            </div>

            

     <?php if ($is_use_captcha) { //자동등록방지  ?>

    <div class="write_div">

        <?php echo $captcha_html ?>

    </div>

    <?php } ?></p>

<p>    <div class="btn_confirm write_div">

        <a href="<?php echo get_pretty_url($bo_table); ?>" class="btn_cancel btn">취소</a>

        <button type="submit" id="btn_submit" accesskey="s" class="btn_submit btn">작성완료</button>

    </div>

   

            

            <div class="request_box">

                <a class="join_btn request_btn" href="#">가입신청</a>

            </div>

    

        </div>

        <!--nib-->

         </form>

  <strong>
 

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

답변에 대한 댓글 1개

작은별
4년 전
설명을 잘못 이해하신 것 같은데요.
function fwrite_submit(f)
이 스크립트 내의 함수는 게시판 글쓰기 페이지에 적용 시에는 write.skin.php 파일 하단에 이미 있습니다. 올려주신 것처럼 따로 추가할 필요가 없습니다.
하단 스크립트에 있는 기존의 함수 중간에 추가하라는 내용입니다.
팁 내용에 보면 빨간색 박스로 별도로 표기까지 되어 있네요.

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

세크티
4년 전

수집동의 html코드가

안에 있나요?

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

답변에 대한 댓글 1개

연탄집개
4년 전
네 모두 <form></form> 안에 있습니다.

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

tuts
4년 전

주신 코드 이용해서 테스트해보니 정상작동합니다

혹시 개발자 도구 console 메뉴에 다른 에러가 떠있지않나요?

 

</p>

<p><script></p>

<p>function fwrite_submit(f)</p>

<p>{</p>

<p>if (!f.wr_10.checked) {</p>

<p>alert("개인정보수집이용에 동의하셔야 작성할 수 있습니다.");</p>

<p>f.wr_10.focus();</p>

<p>return false;</p>

<p>}</p>

<p>return false;</p>

<p>}</p>

<p></script></p>

<p><form method='post' onsubmit='fwrite_submit(this);return false;'></p>

<p><div style="margin:5px 0 0;text-align:right"></p>

<p><label for="wr_10">개인정보수집이용에 동의합니다.</label></p>

<p><input type="checkbox" name="wr_10" value="1"<?php echo ($write['wr_10'] == "1") ? " checked" : "";?>></p>

<p></div></p>

<p><button>확인</button></p>

<p></form></p>

<p> </p>

<p>

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

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

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

로그인