채택완료

개인정보 수집동의 버튼을 추가하고 싶습니다.

2015-11-05 (목) 15:57:21 3,056

아래와 같은 소스에

개인정보동의를 얻고 발송하기를 클릭하면 메시지 전송이 가능하게 하고 싶습니다.

회원가입 부분꺼를 가지고 와봤는데

그냥 전송이 되고 있습니다.

어찌해야 할지 도움 부탁드립니다.

8dd61be1f64b82d30e5ca32e37554421_1446706576_5864.png
 

Copy
<form  name="fregister" id="fregister" action="<?php echo $register_action_url ?>" onsubmit="return fregister_submit(this);" method="POST" autocomplete="off"> 	<section id="fregister_private">        <fieldset class="fregister_agree">            <label for="agree21">개인정보처리방침안내의 내용에 동의</label>            <input type="checkbox" name="agree2" value="1" id="agree21">        </fieldset>    </section> 				<button type="submit" class="btn_frmline">내용보기</button>				<button type="submit" class="btn_frmline">빠른문의</button>     <script>    function fregister_submit(f)    {         if (!f.agree.checked) {            alert("개인정보처리방침안내의 내용에 동의하셔야 회원가입 하실 수 있습니다.");            f.agree.focus();            return false;        }         return true;    }    </script> 			</td>		</tr>	</table></form>

답변 1개 / 댓글 2개

채택된 답변
+20 포인트
2015-11-05 (목) 17:23:49

<input type="checkbox" name="agree2" value="1" id="agree21"> 

if (!f.agree.checked) {


인풋의 name은 agree2이고 펑션에서 체크하는 name은 agree네요.


둘중에 하나로 통일해주시면 될꺼에요~

답변에 대한 댓글 2개

답변 감사합니다.
확인 절차 없이 그냥 발송이 되어 버리고 있습니다.

잘 못한게 있을까요?

[code]
<form name="fregister" id="fregister" action="<?php echo $register_action_url ?>" onsubmit="return fregister_submit(this);" method="POST" autocomplete="off">

<section id="fregister_private">
<fieldset class="fregister_agree">
<label for="agree21">개인정보처리방침안내의 내용에 동의</label>
<input type="checkbox" name="agree" value="1" id="agree21">
</fieldset>
</section>

<button type="submit" class="btn_frmline">빠른문의</button>

<script>
function fregister_submit(f)
{

if (!f.agree.checked) {
alert("개인정보처리방침안내의 내용에 동의하셔야 회원가입 하실 수 있습니다.");
f.agree.focus();
return false;
}

return true;
}
</script>

</td>
</tr>
</table>
</form>
[/code]
2015-11-05 (목) 17:50:51
댓글로 적어주신 소스 그대로 가져다가 실행시켰는데 체크를 하고 있어요..

혹시 fregister_submit이라는 펑션이 또 있으신게 아니실까요???

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