Hi there leopro,
Welcome to the forums 
You can do it like this:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--http://www.sitepoint.com/forums/showthread.php?980483-How-To-enable-button-when-all-chekboxes-are-checked-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Enable button when all checkboxes are checked</title>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
</head>
<body>
<div id="checklist">
<input type="checkbox" value="1" name="1st" class="checkbox" />111<br />
<input type="checkbox" value="2" name="2nd" class="checkbox" />222<br />
<input type="checkbox" value="3" name="3rd" class="checkbox" />333<br />
<input type="checkbox" value="4" name="4th" class="checkbox" />444<br />
<p><button id="show" class="checkcheck" disabled="true">Go on</button></p>
</div><!-- end #checklist -->
<div id="hidden" style="background-color: #448844; opacity: 0.1;">
<h3>HELLO!</h3>
</div><!-- end #hidden -->
<script>
$(document).ready(function() {
var checkboxes = $('input[type="checkbox"]');
checkboxes.change(function(){
buttonState = ($( "input:checked" ).length == 4)? false : true;
$("#show").prop("disabled", buttonState);
});
$("#show").click(function(){
$("#hidden").css("opacity", "0.9");
});
});
</script>
</body>
</html>
The only thing to consider is that once the button has been enabled and clicked, the div will be visible from that point on.
Is this the intended functionality?
Bookmarks