답변 2개 / 댓글 2개
채택된 답변
+20 포인트
7년 전
<input type="checkbox" id="pv_agree" name="pv_agree" required class="agree_ck" />
아니면 이것도 참고하시고..
http://gnustudy.com/bbs/board.php?bo_table=skin_board&wr_id=136
답변에 대한 댓글 2개
7년 전
예제
Copy
<form name="thisForm">
<p class="qna_privacy_agree">
<input type="checkbox" id="pv_agree" name="pv_agree" class="agree_ck" />
<label for="pv_agree" >동의합니다.</label>
</p>
<button type="button" onClick="chk();">확인</button>
</form>
<script>
function chk() {
var f = document.thisForm;
if(f.pv_agree.checked!==true) {
alert('필수항목에 체크해 주세요.');
} else {
alert('통과');
f.submit();
}
}
</script>
답변을 작성하려면 로그인이 필요합니다.