I have dropdowns for a business to enter their hours. Each day has a drop down with the ID of hours_dayname_open and hours_dayname_closed. I also have a checkbox to mark it as closed. I am using the following jQuery to disable the drop down if it is checked:
$("#closed_monday").click( function(){
if($(this).is(':checked')){
$("#hours_monday_open").attr("disabled", true);
$("#hours_monday_closed").attr("disabled", true);
}else{
$("#hours_monday_open").attr("disabled", false);
$("#hours_monday_closed").attr("disabled", false);
}
});
However, when the checkbox is selected only the open hours is disabled/enabled... The closed dropdown seems to be getting ignored.