Updates JavaScript for checking/unchecking checkboxes