Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
horizontal Grouped Radio Buttons don't get checked #2553
Can you post a jsbin or jsfiddle illustrating the issue you're seeing? These seem to toggle:
confirmed, running into the same issue, no need for jsfiddle, http://jquerymobile.com/demos/1.0/docs/forms/radiobuttons/ shows similar behavior...
Original input never gets
pushed a commit
Jan 13, 2012
referenced this issue
Feb 22, 2012
I'm not positive, but I think this was configured better before this change - not sure it was actually a bug. While it's confusing that the checked attribute wasn't updating, I think that's actually expected behavior for properties like "checked", in which the attribute delivers an initial property value of the element, but after that, we'd update the property rather than the attribute. With that original system in place, to check the value, you could use prop() instead of attr()
We switched from attr() to prop() when jQuery core added the method, since in theory, prop should be used for manipulating properties like this after load. Now that it's using attr() again, I don't think the input's actual checked property is being updated anymore, and the new issue #3670 suggests as much. Setting the attribute may be sufficient for form submission
By using attr() to change the value, jQuery's ":checked" selector doesn't seem to find the property, but "[checked]" does, since we're updating the attribute.
I noticed we still have the prop()-based version in the code, commented out beneath it.
@Wilto - I think this was a pull you might have approved... Maybe you could chime in on why we needed to change this back to attr()? I wonder if the following is the change we might need to make:
(before, in the commented-out code, the second call to prop there was using attr() instead, which may have been the real cause of the bug originally. maybe...)
Here's the commit that caused the regression. karol-f@f269788
This one works fine with latest, going to the docs pages referenced
Scrolling to the bottom and selecting the last radio button in the horizontal group and
Will get you
If this really closed ? With Chrome 19, Opera 12 and Firefox Nightly on http://jquerymobile.com/demos/1.1.0/docs/forms/radiobuttons/ I still have this problem... Look at the button, neither