write에서 agree 체크하기
본문
write에서 agree가 checked됐는지 안됏는지..
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" >
생략
<input type="checkbox" class="css-checkbox lrg" name="agree" id="agree" /><label for="agree" class="css-label lrg klaus">개인정보 수집 및 이용에 대해 동의합니다.</label>
생략
</form>
<script>
function fwrite_submit(f)
{
if (!f.agree.checked=="") {
alert("약관 내용에 동의해주세요.");
f.agree.focus();
return false;
}
}
</script>
로 했는데 안되는데 ...
왜그럴까요 ㅠ
!-->
답변 3
아래와 같이 해주세요.
if (f.agree.checked==false) {
...
}
if (!f.agree.checked) {
입니다.
if(f.agree.checked === false) {
}
답변을 작성하시기 전에 로그인 해주세요.