Ticket #7836 (closed bug: notabug)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

Description

 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.

Change History

comment:1 Changed 3 years ago by scott.gonzalez

  • Owner set to audvare
  • Status changed from new to pending

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.

comment:2 Changed 3 years ago by audvare

  • Status changed from pending to new

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').

comment:3 Changed 3 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to invalid

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

Note: See TracTickets for help on using tickets.