Skip to content

Instantly share code, notes, and snippets.

@tlehman
Created March 28, 2012 18:45
Show Gist options
  • Save tlehman/2229323 to your computer and use it in GitHub Desktop.
Save tlehman/2229323 to your computer and use it in GitHub Desktop.
check box toggle
$(document).ready =>
$("#ongoing").bind 'click', (event) =>
end_dates = $("select[id^=project_end_date]")
# toggle the disabled attribute of the end date fields
if ($("#ongoing").attr("checked") != undefined)
end_dates.attr("disabled", true)
else
end_dates.removeAttr("disabled")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment