<html><head>
<script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".chbox").click(function() {
var form = $(this).closest('div');
var c = $(".chbox:checked", form).length;
//alert(c);
if(c>2)
{
$(".chbox", form).prop("disabled", true);
}
});
$("button").click(function(e) {
e.preventDefault() ;
var form = $(this).closest('div') ;
$(".chbox:checked", form).prop("checked", false) ;
$(".chbox", form).prop("disabled", false) ;
}) ;
});
</script></head><body>
<form>
<div>
<p><input type="checkbox" name="1" value="" class="chbox" />1</p>
<p><input type="checkbox" name="2" value="" class="chbox" />2</p>
<p><input type="checkbox" name="3" value="" class="chbox" />3</p>
<p><input type="checkbox" name="4" value="" class="chbox" />4</p>
<p><input type="checkbox" name="4" value="" class="chbox" />5</p>
<button>Заново</button>
<hr>
</div>
<div>
<p><input type="checkbox" name="4" value="" class="chbox" />11</p>
<p><input type="checkbox" name="2" value="" class="chbox" />12</p>
<p><input type="checkbox" name="3" value="" class="chbox" />13</p>
<p><input type="checkbox" name="4" value="" class="chbox" />14</p>
<p><input type="checkbox" name="4" value="" class="chbox" />15</p>
<button>Заново</button>
<hr>
</div>
</form></body></html>