글쓰기 개인정보동의 ???
본문
아래링크를 참고해서 만들었는데.
https://gnustudy.com/bbs/board.php?bo_table=skin_board&wr_id=136
write.skin.php에 아래처럼 처리 했는데 .
동작을 못하네요 무엇이 문제 일까요?
내용을 이렇게 해주도
<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>
스크립트
function fwrite_submit(f)
{
if (!f.wr_10.checked) {
alert("개인정보수집이용에 동의하셔야 작성할 수 있습니다.");
f.wr_10.focus();
return false;
답변 4
스크립트는. "/ } 등 하나라도 빠지면 작동되지 않습니다.
스크립트 구문 닫기 } 해주세요.
주신 코드 이용해서 테스트해보니 정상작동합니다
혹시 개발자 도구 console 메뉴에 다른 에러가 떠있지않나요?
<script>
function fwrite_submit(f)
{
if (!f.wr_10.checked) {
alert("개인정보수집이용에 동의하셔야 작성할 수 있습니다.");
f.wr_10.focus();
return false;
}
return false;
}
</script>
<form method='post' onsubmit='fwrite_submit(this);return false;'>
<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>
<button>확인</button>
</form>
수집동의 html코드가 <form></form>안에 있나요?
<section id="bo_w">
<h2 class="sound_only"><?php echo $g5['title'] ?></h2>
<!-- 게시물 작성/수정 시작 { -->
<script>
function fwrite_submit(f)
{
if (!f.wr_10.checked) {
alert("개인정보수집이용에 동의하셔야 작성할 수 있습니다.");
f.wr_10.focus();
return false;
}
</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 가입">
<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>
<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>
<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>
<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><br>
<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><br>
<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><br>
<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>
<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>
</td>
</tr>
<tr>
<th>카메라 화소</th><!-- wr_5 -->
<td>210만 화소
</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>
<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>
<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>
<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>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php if ($is_use_captcha) { //자동등록방지 ?>
<div class="write_div">
<?php echo $captcha_html ?>
</div>
<?php } ?>
<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>
답변을 작성하시기 전에 로그인 해주세요.