여러 라디오 버튼 그룹이있는 긴 형식으로 작업하고 있습니다.jQuery 모든 라디오 버튼 그룹 선택
하단에는 라디오 버튼 "No All"이 있습니다. 그것이 선택되면 모든 "N"라디오 버튼이 선택되도록 만들고 싶습니다. 그러나 그것을 작동시키지 못합니다.
jQuery를 : 다음 코드의 간략화 된 버전이다
$(document).ready(function(){
//initially hide the Remove All Questions
$("div.#removeAllquest").hide();
//////////// Show Remove All Questions if radio button selected
$("input.#RemoveAll").click(function() {
if ($(this).is(':checked'))
$("input:radio [class*='radioR']").attr("checked",true);
else
$("input:radio [class*='radioR']").attr("checked",false);
});
는});
형태 : 내가 잘못
<table>
<tr>
<td>Y<input type="radio" name="row1" value="row1col1" class="q123col1"></td>
<td>N<input type="radio" name="row1" class="radioR" value="row1col2"></td>
<td>M<input type="radio" name="row1" value="row1col3" class="q123col3"></td>
</tr>
<tr>
<td>Y<input type="radio" name="row2" value="row2col1" class="q123col1"></td>
<td>N<input type="radio" name="row2" class="radioR" value="row2col2"></td>
<td>M<input type="radio" name="row2" value="row2col3" class="q123col3"></td>
</tr>
<tr>
<td>Y<input type="radio" name="row3" value="row3col1" class="q123col1"></td>
<td>N<input type="radio" name="row3" class="radioR" value="row3col2"></td>
<td>M<input type="radio" name="row3" value="row3col3" class="q123col3"></td>
</tr>
<tr>
<td colspan="2">No All </td>
<td>
<input name="RemoveAll" id="RemoveAll" type="radio" value="Y">
</td>
</tr>
</table>
을 뭐하는 거지?
감사합니다. Andy !!! 당신의 첫 번째 옵션을 사용하고 그것은 챔피언처럼 일했습니다. 라디오 버튼을 선택 취소하고 싶습니다 ...하지만 지금까지 너무 오래 걸렸습니다. 지금 당장 머리가 조금 모자라는 걸 알았습니다. :) – Chnikki
"확인 된"속성을 제거해야한다고 생각하지 않습니다. 어쨌든 한 번에 하나의 라디오 버튼 선택 만 선택할 수 있기 때문에 나머지 코드는 좋아 보인다. –