Check and Uncheck Checkbox Dynamically with jQuery : bug? II
I want to use the same functionality as described at Check and Uncheck
Checkbox Dynamically with jQuery : bug? - i.e. one master checkbox and two
slaves checkboxes.
The difference compared to the previous question is that I need to declare
all the checkboxes as button() (as contained here:
http://jqueryui.com/button/#checkbox ):
$(document).ready(function() {
$( "#myCheck" ).button();
$( "#myCheck2" ).button();
$( "#myCheck3" ).button();
$('#myCheck').click(function() {
$('.myCheck').prop('checked', false);
});
$('.myCheck').click(function() {
if ($('.myCheck').is(':checked')) {
$('#myCheck').prop('checked', false);
} else {
$('#myCheck').prop('checked', true);
//alert("Checkbox Master must be checked, but it's not!");
}
});
});
See http://jsfiddle.net/uQfMs/90/
The outcome of this difference is that the functionality is away. I cannot
find why.
No comments:
Post a Comment