In my current jQuery, I have an event that will either check or clear the checkbox if the user clicks on a row in the table. The problem is that if the user does validate the checkbox, jquery fires the checkbox event and checks / unchecks the checkbox, but then the TR event occurs and then uncheck the checkbox value.
See an example here: http://jsfiddle.net/radi8/KYvCB/1/
I can turn off this check box, but if the user tries to check the box, the TR event will not fire.
I need a method to disable the 'click' event, but still allow the TR event to fire when the checkbox is selected.
var charges = {
init: function() {
$('.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();
radi8 source
share