-1
<div id="Page1">
<p><strong><em>(*) 1) Page 1 Question 1</em></strong>
</p>
</div>
<br>
<br>
<div id="Checklist1B7">
<table class="c1">
<tr>
<td width="1%"><label class="c1"><input id="QUESTION1A1" name="S1A" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c4" for="QUESTION1A1">Strongly Disagree</label>
</div>
</td>
<td width="1%"><label class="c2"><input id="QUESTION1A2" name="S1B" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c5" for="QUESTION1A2">Disagree</label>
</div>
</td>
<td width="1%"><label class="c3"><input id="QUESTION1A3" name="S1C" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c6" for="QUESTION1A3">Undecided</label>
</div>
</td>
</tr>
<tr>
<td width="1%"><label class="c1"><input id="QUESTION1A4" name="S1D" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c4" for="QUESTION1A4">Agree</label>
</div>
</td>
<td width="1%"><label class="c2"><input id="QUESTION1A5" name="S1E" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c5" for="QUESTION1A5">Strongly Agree</label>
</div>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(document).on("click", "input[type=checkbox]", function(e) {
var num_checked = $("input[type=checkbox]:checked").length;
if (num_checked > 2) {
alert("sorry, you have already selected more than max !");
$(e.target).attr('checked',false);
}
});
</script>
<p><strong><em>2) Page 1 Question 2</em></strong>
</p>
<br>
<br>
<div id="Checklist2B7">
<table class="c1">
<tr>
<td width="1%"><label class="c1"><input id="QUESTION2A1" name="S2A" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c4" for="QUESTION2A1">Monday</label>
</div>
</td>
<td width="1%"><label class="c2"><input id="QUESTION2A2" name="S2B" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c5" for="QUESTION2A2">Tuesday</label>
</div>
</td>
<td width="1%"><label class="c3"><input id="QUESTION2A3" name="S2C" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c6" for="QUESTION2A3">Wednesday</label>
</div>
</td>
</tr>
<tr>
<td width="1%"><label class="c1"><input id="QUESTION2A4" name="S2D" type=
"checkbox" value="4"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c4" for="QUESTION2A4">Thursday</label>
</div>
</td>
<td width="1%"><label class="c2"><input id="QUESTION2A5" name="S2E" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c5" for="QUESTION2A5">Friday</label>
</div>
</td>
<td width="1%"><label class="c3"><input id="QUESTION2A6" name="S2F" type=
"checkbox"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c6" for="QUESTION2A6">Saturday</label>
</div>
</td>
</tr>
<tr>
<td width="1%"><label class="c1"><input id="QUESTION2A7" name="S2G" type=
"checkbox" value="7"></label>
</td>
<td width="15%">
<div class="c2">
<label class="c4" for="QUESTION2A7">Sunday</label>
</div>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(document).on("click", "input[type=checkbox]", function(e) {
var num_checked = $("input[type=checkbox]:checked").length;
if (num_checked > 4) {
alert("sorry, you have already selected more than max !");
$(e.target).attr('checked',false);
}
});
</script>
<table class="c2">
<tr>
<td>
<div class="c5">
<label class="c5"><button type="submit"><label class=
"c5">NEXT</label></button></label>
</div>
</td>
</tr>
</table>
<div class="c9">
<label>1</label>
</div>
<p id="demo">
</p>
3 개 이상의 체크 박스가 선택되어 있다면 첫 번째 질문의 체크 박스를 비활성화하고 작동하지만 내 문제는 다음과 같습니다. 동일한 페이지에서 모든 체크 박스를 선택하면 차단됩니다.하지만 질문 2에 대해 4 점 미만을 확인하십시오. 당신이 input[type=checkbox]
을 대상으로하는 경우동일한 HTML에서 다른 확인란을 비활성화하는 방법은 무엇입니까?
의 물론 나는 실제로 나는이 사이트를 이해하지 못한다. 나는 "도움이 필요하다"고 말했지만 모든 사람들이 먼저 나를 심문한다. –
그럼 누가 나를 도와 주나요? –
이해가 안되면 [도움]을 읽어야합니다. 모든 것이 여기에 설명되어 있습니다. 박사님, 우리는 정말로 당신을 돕기 위해 여기에 ** 있습니다 **, ** 이것은 ** 모든 사람들을 돕기위한 자원입니다 **. 귀하의 질의 응답은 귀하뿐만 아니라 여러 사람들에게 도움이 될 것으로 기대됩니다. – Liam