Opened 11 years ago

Closed 10 years ago

#7779 closed bug (duplicate)

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

Change History (4)

comment:1 Changed 11 years ago by ghostd


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

comment:2 Changed 11 years ago by Scott González

Status: newopen

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

comment:3 Changed 10 years ago by Scott González


comment:4 Changed 10 years ago by tj.vantoll

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.

Note: See TracTickets for help on using tickets.