I am attempting to utilize jQuery in order to disable a form element once a checkbox is clicked, but for some reason it's not working properly. Can someone help me identify the issue?
$('name="globallyAddTime"').click(function() {
if ($(this).attr('checked')) {
$('name="addedQuantity[]"').attr('disabled', true);
} else {
$('name="addedQuantity[]"').removeAttr('disabled');
}
});
For those who want to check out the jsfiddle, here is the link: