SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Enthusiast kgish's Avatar
    Join Date
    Dec 2001
    Location
    Gouda, The Netherlands
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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:
    Code:
    var obj = document.getElementById('id_dropdown');
    var chk = document.getElementById('id_checkbox');
    if (obj && chk) obj.disabled = !chk.checked;
    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.

    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).
    Last edited by kgish; Jan 8, 2004 at 02:23. Reason: Fixed typos
    Kiffin
    Your average future-famous kind of guy...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •