2014-03-13 2 views
0

체크 박스를 사용하여 어디에서 clausure를 만들려고하는지, 4 개의 체크 박스가 작동하고 1이 작동하지 않는데, 왜 코드가 모든 4에서 작동하기 때문에 작동하지 않는지 알 수 없습니다.내 체크 박스가 모두 하나만 제외하고 작동하는 이유는 무엇입니까?

여기

<input type="checkbox" id="c1" name="cc" class="cc" value="0" /><label for="c1"><span></span></label> 
<input type="checkbox" id="c2" name="cc" class="cc" value="1" /><label for="c2"><span></span></label> 
<input type="checkbox" id="c3" name="cc" class="cc" value="2" /><label for="c3"><span></span></label> 
<input type="checkbox" id="c4" name="ll" class="ll" value="1" /><label for="c4"><span></span></label> 
<input type="checkbox" id="c5" name="ll" calss="ll" value="0" /><label for="c5"><span></span></label> 

$(document).ready(function(){ 

    $('.cc').change(function() { 
    if($(this).is(":checked")) { 
     alert($(this).val()); 
     query = '?filter=type=' + $(this).val(); 
     filter(); 
     return; 
    } 
    query = ''; 
    filter(); 
}); 

    $('.ll').change(function() { 
    if($(this).is(":checked")) { 
     alert($(this).val()); 
     query = '?filter=local=' + $(this).val(); 
     filter(); 
     return; 
    } 
    query = ''; 
    filter(); 
}); 


}); 

누가 좀 도와 줘요 내 코드 JQuery와

HTML의 ... 내 모든 확인란은이 방법을 사용하여 작업 체크 상자를 제외하고 c5 ... 그 체크 박스는 결코 trigged처럼 보이지 않는다. 나는 내가 체크했을 때 경고()를 넣으려고했다. 그러나 경고는 결코 작동하지 않는다. 그래서 C5는 결코 방아쇠를 당길 수 없다. .. 나는 시험해보고있다. 체크 박스가 변경되면 WHERE SQL 쿼리에 인수를 전달하십시오 ...

미리 감사드립니다!

답변

5

오타가 있습니다! 다섯 번째 확인란의 범위는 class 대신 calss입니다.

+1

오그 녀석은 그걸 알아 차리지 못했습니다. 그것을 가리켜 주셔서 감사합니다 !! 내가 만든 바보 같은 미스터리 ... 고마워. –

0

가 교체 클래스에는 CALSS 코드 변화가 없다;

<input type="checkbox" id="c5" name="ll" calss="ll" value="0" /><label for="c5"><span>  </span> </label> 

그걸로 시도해보십시오.

<input type="checkbox" id="c5" name="ll" class="ll" value="0" /><label for="c5"><span>  </span> </label> 
+0

Lars Ebert는 이미 3 분 전에 대답을했습니다. – Satpal

+0

미안보다 저장이 더 좋습니다.) –

관련 문제