Skip to main content

Search and Top Navigation

#7779 closed bug (duplicate)

Opened October 10, 2011 02:04PM UTC

Closed December 06, 2012 08:08PM UTC

datepicker doesn't handle inputs with single quotes in id

Reported by: alh84001 Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.datepicker Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:

Example of this is on

There is no way to pick a date on second and third input field. You can invoke the datepicker, but if you press on any field, nothing happens.

I pinpointed this to _generateHtml() method, line:

(unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\\'#' + /* etc */; string can't be pasted directly into selector because it contains only two slashes, which basically just escapes the slash, and does not escape the single quote. If the is modified to have three slashes before the quote than the selector works as expected.

jQuery version: tested on 1.4.2, 1.6.4,

browsers: IE 9, Firefox 4,

OS: Win 7

Attachments (0)
Change History (4)

Changed November 08, 2011 02:20PM UTC by ghostd comment:1


I put your example in a local file on my box, and i get a date picker for each input with FF 7 (linux).

Changed November 08, 2011 02:25PM UTC by scottgonzalez comment:2

status: newopen

@ghostd, the problem occurs when you select a date, not when you focus the text field.

Changed October 11, 2012 02:43PM UTC by scottgonzalez comment:3


Changed December 06, 2012 08:08PM UTC by tj.vantoll comment:4

resolution: → duplicate
status: openclosed

Duplicate of #8480.This was fixed with in 1.8.23.

You can see the issue here - If you uncomment the master branch files this works fine.