When working on this, ensure that each checkbox has a unique ID if there are multiple checkboxes present. Also, remember to label the checkboxes accordingly.
<div id="collapsibleSetWrapper" data-role="collapsible-set">
<div data-role="collapsible" data-collapsed="true">
<h3>
<span>Title Here</span>
<input class="mycheckbox" type="checkbox" id="uniqueID"/>
<label for="uniqueID"> </label>
</h3>
<div id="mycontent">
<p>Content goes here.</p>
</div>
</div>
</div>
<script>
$('#collapsibleSetWrapper .mycheckbox').checkboxradio({
create: function(event,ui){
var checkbox = $(event.target);
var clickTarget = $(event.target).parent();
$(clickTarget).click(function(e){
if($(checkbox).is(':checked')){
$(checkbox).attr("checked",false).checkboxradio("refresh");
// Perform actions on nested checkboxes when selected
}
else{
$(checkbox).attr("checked",true).checkboxradio("refresh");
// Perform actions on nested checkboxes when deselected
}
e.preventDefault();
return false;
});
}
})
</script>