jquery/jquery-mobile — Issue #3482: removeAttr on radio buttons sets "checked" property of all related radio buttons to false
Author: tscheibl
Created: 2012-01-24 16:54:17+00:00
State: open

This happens in jquery.mobile.forms.checkboxradio.js in line 90:
self._getInputSet().not( input ).removeAttr( "checked" );
after the correct radio button has been checked in line 77 using:
input.attr( "checked", inputtype === "radio" && true || !input.attr( "checked" ) );
After calling this "removeAttr" on only the unselected radio buttons the "checked" property (see prop vs. attr in the jquery docs) of the DOM objects of ALL radio buttons in the same set (carrying the same name attribute) will be set to false (the attribute value of the "checked" attribute in the HTML stays "checked") thus preventing radio button form elements to be transmitted on a submit (form.serialize() recognizes the state of all radio button inputs as false and thus does not serialize it).
Moving the removeAttr line (90) before setting the "checked" attribute (line 77) resolves the issue.
Tested on Firefox 9 and Chromium 17.0.963.3 using jquery-1.7.1 on current HEAD of jquery.mobile.

cheers,
Tom