I have the following piece of code and I don’t see it executing when I check or uncheck a checkbox. Any reason what I’m doing wrong here?
Here is the JSFiddle showing the same:
$("#update_counter_checkbox").change(function() {
if ($(this).prop("checked")) {
// If the checkbox is checked, disable the button
alert("Checked");
console.log("checkbox checked");
$("#dialog-confirm").dialog("widget").find(".ui-button:contains('Login next suggested value " + additionalValue + "')").button("disable");
} else {
alert("Not Checked");
console.log("checkbox NOT checked");
// If the checkbox is unchecked, enable the button
$("#dialog-confirm").dialog("widget").find(".ui-button:contains('Login next suggested value " + additionalValue + "')").button("enable");
}
});