Bug Tracker

Opened 8 years ago

Closed 8 years ago

#7795 closed bug (worksforme)

.append method fails in all version 1.4.x

Reported by: sandro@… Owned by:
Priority: high Milestone: 1.next
Component: manipulation Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

if you use the .append method with a radio input string value with the name attribute and the checked attribute more than 2 times the checked attribute was ignored.

Example: var str1 = "<input id=\"xxx\" type=\"radio\" codice=\"xxx\" name=\"xxx\" value=\"1\" checked />"; $("#xxx").html(""); $("#xxx").append(str1);

if you call this in a onclick event more than 2 times the radio appended will be not checked.

Thanks

Change History (5)

comment:1 Changed 8 years ago by sandro@…

Sorry a type mistake: Example: var str1 = "<input id=\"xxx\" type=\"radio\" codice=\"xxx\" name=\"xxx\" value=\"1\" checked />"; $("#aaa").html(""); $("#aaa").append(str1);

where aaa was a div id.

Sorry

comment:2 Changed 8 years ago by snover

Owner: set to sandro@…
Status: newpending

Please provide a reduced, working test case on jsFiddle.

comment:3 Changed 8 years ago by jitter

Owner: sandro@… deleted
Status: pendingnew

comment:4 Changed 8 years ago by jitter

Component: unfiledmanipulation
Milestone: 1.next1.4.5
Priority: undecidedhigh
Status: newopen

Thanks for taking the time to contribute to the jQuery project by writing a bug report. The next time please pay attention to the big red box which says

Please use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

test case

I can reproduce this problem only on Safari 5 and current Chrome (IE6, Opera 10.63, FF 3.6.13/4.0b7, older Safari are fine). It looks like Webkit now passed the jQuery.support.checkClone check but still fails when appending checked inputs outside of forms.

Last edited 8 years ago by jitter (previous) (diff)

comment:5 Changed 8 years ago by Rick Waldron

Resolution: worksforme
Status: openclosed

Checked radios are correctly appending to all container elements.

Note: See TracTickets for help on using tickets.