Moving checkboxes through document

If you move a checkbox through the document by W3C DOM methods, the checkbox returns to its default state (checked or unchecked).

Test page. Workaround is included.
Reported by ppk.

Explorer 5-6 Windows | Reported on 29 October 2004.

This site is no longer maintained. I’m sorry, but it’s just too much work for too little return. You can continue to browse old bug reports, though.




Search reports by browser:

Atom RSS

Comments

(Add your own)

1 Posted by Huberto Kusters on 24 November 2004 | Permalink

IE Windows uses the property 'defaultChecked' as its initial value.
So my guess is to have the 'onchange' event set this property equal to the 'checked' property, like this:

function checkIt(oInput) {
    if (typeof oInput.defaultChecked != 'undefined') {
        oInput.defaultChecked = oInput.checked;
    }
    return true;
}
...

<input type="checkbox" onchange="checkIt(this);">

2 Posted by Kae on 2 December 2004 | Permalink

This bug seems to also apply when checkboxes are created dynamically.

This script, for example, creates checkboxes dynamically. If the initial state of these must be "checked", then Buberto's workaround must be used.
http://verens.com/archives/2004/09/03/multiselect/

3 Posted by Tony on 13 July 2005 | Permalink

Radio buttons also seem to be affected by this bug.

4 Posted by Graham Lea on 9 February 2006 | Permalink

This problem also occurs when cloning checkboxed.

5 Posted by Guy Terreault on 17 August 2007 | Permalink

I have just tryed the test page
that is supposed to show that
IE7 moves the check box but returns to default setting.

Well I guess that Microsoft has fixed the bug

Because i have
IE7 v 7.0.5730.11
and the check box staid checked