제이쿼리 input radio가 체크되면 다음버튼 활성화 되게 질문입니다

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
제이쿼리 input radio가 체크되면 다음버튼 활성화 되게 질문입니다

QA

제이쿼리 input radio가 체크되면 다음버튼 활성화 되게 질문입니다

본문

<div class="survey_element2">

<div class="reservation_wrap2">

<div class="reservation_time">

<p><img src="<?php echo G5_IMG_URL;?>/time_icon.svg">시간 선택</p>

<img src="<?php echo G5_IMG_URL;?>/arrow_down.svg">

</div>

<div class="black_line"></div>

</div>

<div class="reservation_wrap2_down">

<label for="time">

<input type="radio" name="time" id="time" hidden value="">

<p class="time_text">9:00 ~</p>

</label>

<label for="time">

<input type="radio" name="time" id="time" hidden value="">

<p class="time_text">9:30 ~</p>

</label>

<label for="time">

<input type="radio" name="time" id="time" hidden value="">

<p class="time_text">10:00 ~</p>

</label>

<label for="time">

<input type="radio" name="time" id="time" hidden value="time"/>

<p class="time_text">11:00 ~</p>

</label>

 

<div class="time_select">

<p class="select_ok"><span></span>선택</p>

<p class="select_no"><span></span>불가</p>

</div>

<div class="grey_line"></div>

</div>

</div>

 

 

 

 

---> 스크립트

function next_btn_validation(index){

if(index == "1") {

var count = 0;

$('select[name=questions] :selected').each(function(){

if($(this).val() > 0){

count++;

}

 

if($(this).val() > 0){

$('#next_btn').prop('disabled', false);

}else {

$('#next_btn').prop('disabled', true);

}

//비활성화일때 다음으로 넘어가기 방지

});

console.log(count);

}else if(index == "2"){

//var count = 0;

var count2 = $('input:radio[name=time]:checked').val();

$('input:radio[name=time]').on('change', function(){

if($(this).val == ''){

}

})

console.log(count);

 

}else if(index == "3"){

 

}


 

var total_question_count = $('.q' + index).find('.my_hidden_input').val();

if(count == total_question_count){

$('#next_btn').attr('class','next');

}else {

$('#next_btn').attr('class','btn_deactivated');

}

 

 

}

 

// select 할때 next_btn_validation

$('select[name=questions]').on('change', function(){

 

var index = $('#navigation').find('li.active').index();

next_btn_validation(index);

 

});

 

//input check 할때 next_btn_validation

$('input:radio[name=time]').on('change', function(){

var index = $('#navigation').find('li.active').index();

next_btn_validation(index);

})


 

 

input이 체크가 되면 넘어가게 하고 싶습니다... 짜다가 도저히 머리가 안돌아가 고수님들께 여쭤봅니다...

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 1
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT