Skip to main content

Search and Top Navigation

#7836 closed bug (notabug)

Opened November 06, 2011 10:14AM UTC

Closed November 08, 2011 12:32PM UTC

IE7 & IE10: buttonset with radio buttons fails to select option

Reported by: audvare Owned by: audvare
Priority: minor Milestone: 1.9.0
Component: ui.button Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:

jsFiddle example

IE 10 Screenshot

I know it may be early for IE10, but I have a set of radio buttons with the required attribute placed on all of them. This works great in IE8/9 (they ignore required as it is unsupported), Chrome, Safari and Firefox. I even tried Konqueror.

IE 7 APPEARS to select the option but $(':checked') selector returns 0.

IE10 supports the required attribute so when I hit submit it just pops up a box saying 'You must choose an option.'. I do want this box to appear should the user not pick anything (I have fallbacks for when the browser lacks validity checks in my code), but I do not want to have the same fallback for IE10 as I do with IE7 (which I do not believe is possible). Perhaps a regression on MS' part, but their validity check runs before any event listeners to form submit event preventing the same fallback for IE7 to work in IE 10.

The fallback for IE7 is to get the selected option by class via the clicked label, then get the .prev() radio button and set it to .prop('checked', true) before submitting.

On my site I'm using 1.8.11 but the jsFiddle is using 1.8.16.

Attachments (0)
Change History (3)

Changed November 08, 2011 11:22AM UTC by scottgonzalez comment:1

owner: → audvare
status: newpending

I'm confused by this ticket. What is the bug? You seem to be asking for advice on how to work around an issue with when validation is run, not how to deal with a bug in the button widget.

Changed November 08, 2011 12:18PM UTC by audvare comment:2

status: pendingnew

The bug is that $('input[type="radio"]:checked').size() (or .length) === 0 in IE 10 and 7 when I'm expecting to be === 1 after having clicked one of the buttons. I'm expecting one the <input type="radio"> to have a 'checked' property. This happens in all browsers except IE7 and 10 (have not tested IE 6).

Unless I'm checking the wrong way (don't see a mention in the documentation how to check a value is picked or how to get the picked value) or using the API the wrong way (don't see how that could be), I consider this a bug.

I mention validation because IE 10 supports the 'required' attribute and its validation handler runs before any submit event handlers (where I normally add a listener function to post the form via AJAX). Still, the bug is the same (not making an <input> 'checked').

Changed November 08, 2011 12:32PM UTC by scottgonzalez comment:3

resolution: → invalid
status: newclosed

It should be 0, because nothing is checked. This also has nothing to do with jQuery UI.