I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function
by the way i think the value of disabled is "disabled" Good Luck, David On Jan 18, 3:32 pm, Toaster <mr.toas...@gmail.com> wrote: > Hey > > I was wondering on how I might be able to have a checkbox that when > checked or unchecked would disable or enable a dropdown. > > I am still very new to jQuery but this is what I have but doesnt work. > > ---------------------------------------------------------------------------- > function stillWork(id) { > if ($(id).is(':checked')) > { > $("#work_month_end_1").attr("disabled", true); > $("#work_year_end_1").attr("disabled", true); > } > if ($(id).not(':checked')) > { > $("#work_month_end_1").removeAttr("disabled"); > $("#work_year_end_1").removeAttr("disabled"); > } > } > ---------------------------------------------------------------------------- > > I also experimented with a couple other ways and it usually gives me a > problem where it automatically unchecks a box after checking it/ > running the js. > > Thanks in advance