회원가입 약관동의 전체동의 보완

그누보드 5.5.8.2.7 버전기준(이전버전 포함)

회원가입 시 약관동의 페이지에서 전체 동의 부분

 

전체동의 체크 후 각 약관 해제 시 전체동의에 체크되어 있음

각각의 동의사항 체크하게되면 전체동의 체크 안됨

 

 

238570509_1675557262.6468.png

 

해결방안

현재 적용중인 테마의 skin/member/ 폴더의 register.skin.php 파일

91~100번째 줄

[code]

    jQuery(function($){
        // 모두선택
        $("input[name=chk_all]").click(function() {
            if ($(this).prop('checked')) {
                $("input[name^=agree]").prop('checked', true);
            } else {
                $("input[name^=agree]").prop("checked", false);
            }
        });
    });

[/code]

 

의 내용을 아래와 같이 변경해 주시면 됩니다.

[code]

    /* 체크박스 전체 관련 오류 수정 2023-02-05 */
    jQuery(function($){
        $("input[name=chk_all").click(function() {
            if($("input[name=chk_all").is(":checked")) $("input[name=agree],input[name=agree2]").prop("checked", true);
            else $("input[name=agree],input[name=agree2]").prop("checked", false);
        });

        $("input[name=agree],input[name=agree2]").click(function() {
            var total = $("input[name=agree],input[name=agree2]").length;
            var checked = $("input[name=agree]:checked,input[name=agree2]:checked").length;

            if(total != checked) $("input[name=chk_all").prop("checked", false);
            else $("input[name=chk_all").prop("checked", true); 
        });
    });

[/code]

 

적용하게되면 각각 체크박스 선택 시 자동으로 전체동의에 체킹

전체동의 체크 후 각 체크박스 해제전체동의 체크해제가 가능해 집니다.

|

댓글 5개

그러네요.. 감사 합니다.
유용한 정보 감사합니다.

감사합니다.

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

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
2년 전 조회 2,210
2년 전 조회 2,781
2년 전 조회 1,947
2년 전 조회 3,537
2년 전 조회 2,901
2년 전 조회 1,838
2년 전 조회 1,496
2년 전 조회 1,847
2년 전 조회 2,355
2년 전 조회 1,844
2년 전 조회 2,077
2년 전 조회 2,576
2년 전 조회 2,030
2년 전 조회 2,494
2년 전 조회 2,405
3년 전 조회 3,596
3년 전 조회 3,156
3년 전 조회 1,527
3년 전 조회 1,890
3년 전 조회 2,161
3년 전 조회 2,301
3년 전 조회 2,029
3년 전 조회 2,414
3년 전 조회 3,495
3년 전 조회 2,613
3년 전 조회 2,630
3년 전 조회 2,131
3년 전 조회 2,796
3년 전 조회 2,560
3년 전 조회 1,910
🐛 버그신고