IE bug for disabling form controls?
I would like to implement a checkbox within a form that when checked will enable a certain dropdown list element. When the checkbox is unchecked, the element will become disabled (and grayed out).
I do this by using the following code from within the checkbox onchange-handler:
This works just fine in Opera, Mozilla and Firebird. However, IE 6 seems to have a bug. The control is not disabled (nor grayed) until either the control is clicked or I click somehwere else on the form.
var obj = document.getElementById('id_dropdown');
var chk = document.getElementById('id_checkbox');
if (obj && chk) obj.disabled = !chk.checked;
This is very aggravating indeed...
Is this a known bug? If so, then is there a workaround I can use?
(Hint: I've tried doing a setTimeout for a delayed disable, but this does not help either).