I am using this code to disable a dropdown when user clicks on a checkbox
function onCheckChange() {
if ($("#all_day_checkbox").is(':checked'))
$("#evt_time_drop").attr('disabled', 'disabled');
else
$("#evt_time_drop").removeAttr('disabled');
}
$("#all_day_checkbox").click(onCheckChange).change(onCheckChange);
This works fine. But I would like to add an instruction to inject a true or false value to the checkbox so this can be stored in the database.
Unfortunately this doesn't work:
function onCheckChange() {
if ($("#all_day_checkbox").is(':checked'))
$("#evt_time_drop").attr('disabled', 'disabled');
$("#all_day_checkbox").val("TRUE");
else
$("#evt_time_drop").removeAttr('disabled');
$("#all_day_checkbox").val("FALSE");
}
$("#all_day_checkbox").click(onCheckChange).change(onCheckChange);
Anyone have suggestions to get to work?
Thanks for your help!