I have attached a minimal test case to reproduce. There are four pairs of radiobuttons, each having one radio button selected. Their source markup is functionally identical. Clicking the provided link runs a different animation on each radio button pair: the first two pairs of radio buttons lose their selection, the last two work fine.
This is caused by the code in jQuery.css() used to measure the dimensions of elements that are hidden. jQuery temporarily replicates the element inside its parent. This causes two selected radio buttons with the same 'name' to appear in the form, which is not allowed. It seems that Firefox and Opera defensively remove both selections in this case.
One fix is to simply remove the checked attributes of all radio buttons inside the clone, before inserting it into the parent. See attached patch.
This is a major blocker for jQuery in Drupal by the way, as it can break any animated portion of a form. I'm going to patch our included copy after you guys review this patch (we have a release candidate coming up next monday), but it would be nice to see this fixed in a 1.0.3 release soon ;).
Steven Wittens
jquery-radio-bug.patch
Description: Binary data
Title: jQuery Radio bug
Problem: when using some animations on an element containing one or more radio buttons, the radiobuttons will lose their selection in Firefox and Opera, the first time the animation is applied.
slideDown: Buggy
animated show: Buggy
fadeIn: Not Buggy
instant show: Not Buggy
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/