Skip to main content

Bug Tracker

Side navigation

#6432 closed bug (duplicate)

Opened April 14, 2010 03:23AM UTC

Closed June 15, 2010 12:45AM UTC

Can create chkbox in IE8,bug can't checked it

Reported by: zhaixp1949 Owned by:
Priority: Milestone: 1.4.2
Component: unfiled Version: 1.4.2
Keywords: IE8 checkbox Cc:
Blocked by: Blocking:
Description

$("<input>",{

"class":"ipt_blur",

checked : true,

type:"checkbox",

val:"Test"

}).appendTo("form");

Attachments (1)
  • test.html (0.3 KB) - added by simon.brent May 10, 2010 01:25PM UTC.
Change History (5)

Changed April 14, 2010 03:28AM UTC by zhaixp1949 comment:1

test by IE 6,7 ,the same result as 8

Changed April 15, 2010 12:01AM UTC by dmethvin comment:2

resolution: → worksforme
status: newclosed

Your example works for me in IE8, it creates a check box that is checked. If you have an example that fails, reopen the ticket with a complete test file.

FYI, although it doesn't seem to affect your example, perhaps it is relevant. If you don't specify a type when creating a checkbox in IE, it defaults to text. Once created, it can only be changed once. This is a limitation in IE.

http://msdn.microsoft.com/en-us/library/ms534700%28VS.85%29.aspx

Changed May 10, 2010 01:26PM UTC by simon.brent comment:3

resolution: worksforme
status: closedreopened

I have exactly the same problem - I've attached an example which doesn't work in IE6 or IE7. It appears to work in IE8 however, which is somewhat confusing since I originally ran across the problem there.

Changed June 12, 2010 02:32AM UTC by dmethvin comment:4

Unfortunately, this is due to an underlying bug in IE. When a checkbox element is appended (independently of jQuery) it always loses the checked attribute. There isn't a simple workaround at the jQuery level.

Historical references:

http://www.mularien.com/blog/2008/08/06/stupid-ie-6-bug-182478-check-boxes-added-through-javascript-arent-checked/

http://social.msdn.microsoft.com/Forums/en/iewebdevelopment/thread/e74a8779-5db0-4e91-b9c1-70253bcb936d

http://www.felocity.org/blog/article/documentcreateelement_and_checkboxes/

Changed June 15, 2010 12:45AM UTC by dmethvin comment:5

resolution: → duplicate
status: reopenedclosed

Dup of #3879.