Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#8060 closed bug (fixed)

Setting checked to true on a disconnected checkbox does not carry over after attaching to DOM.

Reported by: anonymous Owned by: timmywil
Priority: blocker Milestone: 1.6
Component: manipulation Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Change History (19)

comment:1 Changed 6 years ago by jitter

Component: unfiledattributes
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

I made this quick test case but can't seem to reproduce your problem in IE6.

Please report back if you can provide a reduced test case on http://jsfiddle.net which reproduces your issue.

comment:2 Changed 6 years ago by ajpiano

Resolution: worksforme
Status: closedreopened

comment:3 Changed 6 years ago by ajpiano

Owner: set to anonymous
Status: reopenedpending

comment:4 in reply to:  3 Changed 6 years ago by anonymous

Status: pendingnew

Replying to ajpiano: will do tomorrow.

comment:5 Changed 6 years ago by Protorium

Ticket #8060 (closed bug: worksforme)

Opened 5 weeks ago

Last modified 5 weeks ago $(":checkbox").attr("checked","checked");not effect under ie6

I can reproduce a scenario where the above is true... i.e. doesn't check in IE6.0 when does in FF/Safari/IE7/8.

Create an object and try .attr( "checked", true ); before adding the item to an item already in the document.

For example... http://jsfiddle.net/protoriumatwork/MwtCW/4/

My guess is IE6 isn't happy until the object you are modifying actually exists in the document and can be obtained using document.getElementById... This isn't a major issue and may be using jQuery as it was not intended, but if jquery combined with other popular browsers allows this then shouldnt jQuery and IE 6.0?

comment:6 Changed 6 years ago by dmethvin

Milestone: 1.next1.6
Priority: lowblocker
Status: newopen

comment:7 Changed 6 years ago by john

Owner: changed from anonymous to timmywil
Status: openassigned

comment:8 Changed 6 years ago by timmywil

I'm starting to think this is not an issue with attr, but an issue encountered somewhere between setting the attribute and appending it to the DOM. Before appending, the attribute is set correctly. After appending, it is no longer set. updated test case pic of ie6 and ie7 failure

comment:9 Changed 6 years ago by timmywil

Summary: $(":checkbox").attr("checked","checked");not effect under ie6Setting checked to true on a disconnected checkbox does not carry over after attaching to DOM.

comment:10 Changed 6 years ago by timmywil

Description: modified (diff)

comment:11 Changed 6 years ago by timmywil

Component: attributesmanipulation
Version: 1.4.41.5.2

comment:12 Changed 6 years ago by timmywil

Resolution: duplicate
Status: assignedclosed

Gnarf's upcoming patch for #8500 addresses this same issue.

comment:13 Changed 6 years ago by timmywil

Duplicate of #8500.

comment:14 Changed 6 years ago by timmywil

Resolution: duplicate
Status: closedreopened

comment:15 Changed 6 years ago by timmywil

#8500 is a duplicate of this ticket.

comment:16 Changed 6 years ago by timmywil

Status: reopenedassigned

comment:17 Changed 6 years ago by gnarf

comment:18 Changed 6 years ago by timmywil

#8920 is a duplicate of this ticket.

comment:19 Changed 6 years ago by timmywil

Resolution: fixed
Status: assignedclosed

Landing pull request 332. Appending disconnected radio or checkbox inputs and keeping checked setting Fixes #8060, #8500.

More Details:

Note: See TracTickets for help on using tickets.