I recently asked a question about how to get a series of checkboxes disabled when ONE is clicked. Well the following code does that: jsfiddle example. The problem I have now, and should ave tested for before was form submission.
The checkbox stays clicked but the siblings now remain enabled when they should be disabled. Any tips on what I have to change in the following to make that happen so that as long as the first checkbox remains clicked the rest remain disabled?
$(function () {
$("#disable").change(function () {
$(this).closest('.control-group').siblings('.control-group').find('input').attr("disabled", $(this).is(":checked"));
});
});
I suspect your form submission results in a postback. If, as you said, the checkbox will remain checked on this postback, you can modify your code like so: