the delete
link don't work when I upgrading from jquery 1.5 to jquery 1.5.1:
Asked
Active
Viewed 263 times
1

Cheerio
- 1,260
- 6
- 19
- 37
1 Answers
5
This was a bug with the clone() method that was introduced in jQuery 1.5, and fixed in 1.5.1.
The default behaviour with clone()
should be to not copy the events and data of the cloned element, however this was not the case with 1.5 (where the default behaviour was to copy the events).
To fix your code, change:
$('#add-input').click(function() {
main.append(clonedField.clone());
return false;
});
to
$('#add-input').click(function() {
main.append(clonedField.clone(true));
return false;
});
Working fiddle: http://jsfiddle.net/EfsGN/7/

Matt
- 74,352
- 26
- 153
- 180
-
Just thank you for the answer. very useful. I will give 100+ if I could. – Cheerio Feb 28 '11 at 14:35