2016-10-12 3 views
0

사용자가 허용을 클릭하면 거부가 비활성화되거나 거부를 클릭하면 허용이 비활성화됩니다.나는 체크 박스가 체크되어 있는지 확인하고 싶습니다. 아니면 현재의 트로이가 아닙니다 ... 어떻게 가능합니까?

enter image description here

이 당신이 정말이 방법을 수행하려는 경우 내 테이블 구조 ..

<table class="table table-bordered table-hover"> 
    <thead> 
     <tr> 
      <th> Sequence </th> 
      <th> Name</th> 
      <th> Allow </th> 
      <th> Deny </th> 
     </tr> 
    </thead> 
    <tbody> 

     <tr> 
      <th class="active">Repositary Service</th> 
     </tr> 
     <tr class="access_tr"> 
      <td class="sr_no"> 1 </td> 
      <td> Select File </td> 
      <td> <input type="checkbox" class="rights_checkbox" value="select_file/1" name=""> </td> 
      <td> <input type="checkbox" class="rights_checkbox" value="select_file/2" name=""> </td> 

     </tr> 
    </tbody> 
</table> 
+0

사용 라디오 버튼이 – guradio

+0

이 참 ... 난 그 트릭을 사용하는 트릭을 할 것입니다하지만 난 여전히 그냥 확인 작업 것으로 예상 확인란 –

+0

에 대해 서로 다른 다양한 TD는이다 라디오 버튼의 이름은 같습니다. 그들은 서로를 전환합니다 – guradio

답변

0

$('#yourTalbeId').find('tr').each(function() { 
     var row = $(this); 
     if (row.find('input[type="checkbox"]').is(':checked')) { 
      alert('Checked'); 
     } 
    }); 
+0

감사합니다 workng.l .. –

+0

다음 제 대답을 받아주십시오 Logged –

0
$('.rights_checkbox').on("change", function() { 
    var $checkboxes = $(this).closest("tr").find(".rights_checkbox"); 

    $checkboxes.show(); 

    if($(this).is(":checked")) { 
     $checkboxes.not(this).hide(); 
    } 
}); 

비트 복잡한 시도하지만, 그것은을 일할거야.

jsFiddle : 같은 이름을 가진 https://jsfiddle.net/gkezcxh4/1/