Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 4 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 5 years ago by jitter

  • Component changed from unfiled to attributes
  • Priority changed from undecided to low
  • Resolution set to worksforme
  • Status changed from new to closed

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 5 years ago by ajpiano

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:3 follow-up: Changed 5 years ago by ajpiano

  • Owner set to anonymous
  • Status changed from reopened to pending

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

  • Status changed from pending to new

Replying to ajpiano: will do tomorrow.

comment:5 Changed 5 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 5 years ago by dmethvin

  • Milestone changed from 1.next to 1.6
  • Priority changed from low to blocker
  • Status changed from new to open

comment:7 Changed 5 years ago by john

  • Owner changed from anonymous to timmywil
  • Status changed from open to assigned

comment:8 Changed 5 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 5 years ago by timmywil

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

comment:10 Changed 5 years ago by timmywil

  • Description modified (diff)

comment:11 Changed 5 years ago by timmywil

  • Component changed from attributes to manipulation
  • Version changed from 1.4.4 to 1.5.2

comment:12 Changed 5 years ago by timmywil

  • Resolution set to duplicate
  • Status changed from assigned to closed

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

comment:13 Changed 5 years ago by timmywil

Duplicate of #8500.

comment:14 Changed 5 years ago by timmywil

  • Resolution duplicate deleted
  • Status changed from closed to reopened

comment:15 Changed 5 years ago by timmywil

#8500 is a duplicate of this ticket.

comment:16 Changed 5 years ago by timmywil

  • Status changed from reopened to assigned

comment:17 Changed 5 years ago by gnarf

comment:18 Changed 5 years ago by timmywil

#8920 is a duplicate of this ticket.

comment:19 Changed 5 years ago by timmywil

  • Resolution set to fixed
  • Status changed from assigned to closed

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.