Skip to main content

Search and Top Navigation

#7534 closed bug (fixed)

Opened July 06, 2011 05:21PM UTC

Closed August 04, 2011 03:16AM UTC

Last modified January 20, 2012 05:19PM UTC

Button label selector omits quotes / fails for ids with ":"

Reported by: jabouillei Owned by:
Priority: minor Milestone: 1.8.16
Component: ui.button Version: 1.8.14
Keywords: Cc:
Blocked by: Blocking:
Description

The button label selector uses the id of the checkbox

without quoting it. Here is the relevent line of

UI Button code:

labelSelector = "label[for=" + this.element.attr("id") + "]";

If the id contains a colon or some other interesting character

labelSelector becomes, for example,

label[for=sample:123]

instead of

label[for="sample:123"]

Here is a jsfiddle demonstrating the problem:

http://jsfiddle.net/jgQaV/1/

I encountered the problem in 1.8.11 and reproduced it in 1.8.14.

The fix is trivial:

labelSelector = "label[for=\\"" + this.element.attr("id") + "\\"]";

I'm making this change in a github fork and will request a pull

in a few minutes.

Attachments (0)
Change History (5)

Changed July 06, 2011 05:32PM UTC by jabouillei comment:1

Changed August 04, 2011 03:16AM UTC by Corey Frang comment:2

resolution: → fixed
status: newclosed

Button: Adding quotes to the attribute selector for labels - Fixes #7534 - Button label selector omits quotes / fails for ids with ":"

Changeset: 065aef537b7533046907fcffc6896949e44679eb

Changed August 04, 2011 03:19AM UTC by Corey Frang comment:3

Button: Adding quotes to the attribute selector for labels - Fixes #7534 - Button label selector omits quotes / fails for ids with ":"

(cherry picked from commit 065aef537b7533046907fcffc6896949e44679eb)

Conflicts:

ui/jquery.ui.button.js

Changeset: 07d5271f7eac17a1a732b562b836b12a889e3b60

Changed August 04, 2011 03:55AM UTC by gnarf comment:4

milestone: 1.91.8.16

Changed January 20, 2012 05:19PM UTC by scottgonzalez comment:5

#7461 is a duplicate of this ticket.