In my current JQuery, I have an event that will either check or uncheck a checkbox if the user clicks on a row in a table. The problem with this is, if the user actually checks the checkbox, the jquery will fire on the checkbox event and either check/uncheck the box, but then the TR event will fire and then undo the checkbox value.
See an example here: http://jsfiddle.net/radi8/KYvCB/1/
I can disable the checkbox but then if the user tries to select the checkbox, the TR event will not trigger.
What I need is a method to disable the 'click' event of the checkbox but still allow the TR event to fire when the checkbox is selected.
var charges = {
init: function() {
// get the selected row checkbox
//$('.charges').attr('disabled', true);
$('.rowclick tr').click(function() {
if ($(this).find('td input.charges:checkbox').is(':checked')) {
$(this).find('td input.charges:checkbox').attr("checked", false);
}
else {
$(this).find('td input.charges:checkbox').attr("checked", true);
}
});
}
};
charges.init();