Bug Tracker

Opened 9 years ago

Closed 9 years ago

#6432 closed bug (duplicate)

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 (299 bytes) - added by simon.brent 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by zhaixp1949

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

comment:2 Changed 9 years ago by dmethvin

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 9 years ago by simon.brent

Attachment: test.html added

comment:3 Changed 9 years ago by simon.brent

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.

comment:4 Changed 9 years ago by dmethvin

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/

comment:5 Changed 9 years ago by dmethvin

Resolution: duplicate
Status: reopenedclosed

Dup of #3879.

Note: See TracTickets for help on using tickets.